Quest Brothers Bound in Chains (500).

Contributed by Mathael.
This commit is contained in:
MobiusDev 2016-07-21 20:17:46 +00:00
parent ba3306f436
commit dad40c433d
12 changed files with 297 additions and 3 deletions

View File

@ -0,0 +1,18 @@
<html>
<body>
Dark Judge:
<br><br>
I may look like this now, but I was once an angel of light.
But the light was put to sleep, and darkness filled the lands...
we fought, all of us angels, but it was a losing battle.
Then, when I was growing weary, the god of chaos beckoned.
"Chaos is the ultimate peace and silence," he whispered, and I did not have the strength to resist him.
<br>
<br>
But I ended up regretting my decision in the end.
So I made another deal with the god of chaos; I would bring him enough
"sins" to cancel out my own. So here's my offer to you: I will buy your sin.
After all, penitence is the only path to light. Will you accept?
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00500_BrothersBoundInChains 30981-02.htm">"Yes, I want penitence."</Button>
</body>
</html>

View File

@ -0,0 +1,10 @@
<html>
<body>
Dark Judge:
<br><br>
Do you wish to return to the light?
Then you, too, must bring back enough sens to cancel out your own.
To that end, you need tangible evidence for your penitence.
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00500_BrothersBoundInChains 30981-03.htm">"How do I get this tangible eidence?"</Button>
</body>
</html>

View File

@ -0,0 +1,8 @@
<html>
<body>
Dark Judge:
<br><br>
The evidence is called <font color="LEVEL">Crumbs of Penitence</font>, and you can get them through Sin Eater summoned with Penitent's Menacles. I can make Penitent's Manacles for you if you bring <font color="LEVEL">200 Gemstones (B-Grade)</font> from the village merchant.
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00500_BrothersBoundInChains 30981-04.htm">"Here are the Gemstones (B-Grade)."</Button>
</body>
</html>

View File

@ -0,0 +1,8 @@
<html>
<body>
Dark Judge:
<br><br>
I will give you <font color="LEVEL">Penitent's Manacles</font> so that you can summon the Sin Eater. Summoning the Sin Eater begins the <font color="LEVEL">Hour of Penitence</font>, during which you can obtain <font color="LEVEL">Crumbs of Penitence</font> by defeating as many monsters as possible. Bring me <font color="LEVEL">10 Crumbs of Penitence</font>, and I will free you of your sin.
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00500_BrothersBoundInChains 30981-06.htm">"I will be back with Crumbs of Penitence."</Button>
</body>
</html>

View File

@ -0,0 +1,7 @@
<html>
<body>
Dark Judge:
<br><br>
It seems you don't have enough <font color="LEVEL">Gemstone (B-Grade)</font>. You can get them from a village grocer. Remember, you need <font color="LEVEL">200</font> of them.
</body>
</html>

View File

@ -0,0 +1,7 @@
<html>
<body>
Dark Judge:
<br><br>
Do not tarry; bring me 10 <font color="LEVEL">Crumbs of Penitence</font> so that I can free you from your sin. But remember, bringing more than 10 will do no good, for not all sins can be cleared in one day.
</body>
</html>

View File

@ -0,0 +1,7 @@
<html>
<body>
Dark Judge:
<br><br>
It seems ou don't have enough <font color="LEVEL">Crumbs of Penitence</font> yet. Did you forget how to obtain them ? Equip the <font color="LEVEL">Penitent's Manacles</font> I have given you, summon Sin Eater, and defeat as many monsters as you can during the <font color="LEVEL">Hour of Penitence</font>. You need 10 <font color="LEVEL">Crumbs of Penitence</font> obtained from the battle.
</body>
</html>

View File

@ -0,0 +1,8 @@
<html>
<body>
Dark Judge:
<br>
What did you learn while gathering <font color="LEVEL">Crumbs of Penitence</font>? Committing sin is easy, but reversing it is much less so. Never forget that every choice has consequence. Now, give me what you have gathered, and the Penitent's Manacles. I will clear away your sin.
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00500_BrothersBoundInChains 30981-09.html">"Here are the Crumbs of Penitence and the Penitent's Manacles."</Button>
</body>
</html>

View File

@ -0,0 +1 @@
<html><body>Dark Judge:<br>Now, your sins are forgiven. But not all sins can be forgiven in a day; there is only so much I can forgive today.<br> Never forget the regret and suffering you went through for your mistakes. </body></html>

View File

@ -0,0 +1,12 @@
<html>
<body>
Black Judge:
<br><br>
Everyone commits sin, whether great or small. And when the sin becomes great,
you move away from the light until you become darkness. Sin is close to your nature,
and can only be eliminated when your soul is string. Come again sometime,
and I will help you step closer to the light.
<br><br>
(This quest is available only to main class characters who are level 61 or above, and have a PK count above 0.)
</body>
</html>

View File

@ -0,0 +1,206 @@
/*
* 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.Q00500_BrothersBoundInChains;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.enums.QuestType;
import com.l2jmobius.gameserver.model.CharEffectList;
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.character.npc.OnAttackableKill;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
/**
* @author Mathael
* @URL https://l2wiki.com/Brothers_Bound_in_Chains
* @version Infinite Odyssey
*/
public class Q00500_BrothersBoundInChains extends Quest
{
// NPCs
private static final int DARK_JUDGE = 30981;
// Items
private static final int GEMSTONE_B = 2132;
private static final int PENITENT_MANACLES = 36060; // TODO: check: multiple items with this name
private static final int CRUMBS_OF_PENITENCE = 36077;
private static final int DROP_QI_CHANCE = 1; // in % TODO: check
// Misc
private static final int HOUR_OF_PENITENCE[] =
{
15325,
15326,
15327,
15328,
15329
};
private static final int MIN_LEVEL = 60;
public Q00500_BrothersBoundInChains()
{
super(500);
addStartNpc(DARK_JUDGE);
addTalkId(DARK_JUDGE);
registerQuestItems(PENITENT_MANACLES, CRUMBS_OF_PENITENCE);
addCondMinLevel(MIN_LEVEL, "30981-nopk.htm");
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return getNoQuestMsg(player);
}
switch (event)
{
case "30981-02.htm":
case "30981-03.htm":
{
break;
}
case "30981-04.htm":
{
if (takeItems(player, GEMSTONE_B, 200))
{
giveItems(player, PENITENT_MANACLES, 1);
}
else
{
event = "30981-05.html";
}
break;
}
case "30981-06.htm":
{
qs.startQuest();
break;
}
case "30981-09.html": // not retail html.
{
if (takeItems(player, CRUMBS_OF_PENITENCE, 10))
{
player.setPkKills(Math.max(0, player.getPkKills() - Rnd.get(1, 10)));
qs.exitQuest(QuestType.DAILY, true);
}
else
{
// If player delete QuestItems: Need check how it work on retail.
qs.setCond(1);
event = "30981-07.html";
}
break;
}
default:
{
event = getNoQuestMsg(player);
}
}
return event;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
String htmltext = getNoQuestMsg(talker);
final QuestState qs = getQuestState(talker, true);
if (qs == null)
{
return htmltext;
}
switch (qs.getState())
{
case State.CREATED:
{
htmltext = (talker.getPkKills() > 0) && (talker.getReputation() >= 0) ? "30981-01.htm" : "30981-nopk.htm";
break;
}
case State.STARTED:
{
switch (qs.getCond())
{
case 1:
{
htmltext = "30981-07.html";
break;
}
case 2:
{
htmltext = "30981-08.html"; // not retail html.
break;
}
}
break;
}
case State.COMPLETED:
{
if (qs.isNowAvailable())
{
qs.setState(State.CREATED);
htmltext = "30981-01.htm";
}
break;
}
}
return htmltext;
}
@RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@RegisterType(ListenerRegisterType.GLOBAL_MONSTERS)
public void onAttackableKill(OnAttackableKill event)
{
final QuestState qs = getQuestState(event.getAttacker(), false);
if (qs == null)
{
return;
}
// Player can drop more than 10 Crumbs of Penitence but there's no point in getting more than 10 (retail)
boolean isAffectedByHourOfPenitence = false;
final CharEffectList effects = event.getAttacker().getEffectList();
for (int i = 0; !isAffectedByHourOfPenitence && (i < HOUR_OF_PENITENCE.length); i++)
{
if (effects.isAffectedBySkill(HOUR_OF_PENITENCE[i]))
{
isAffectedByHourOfPenitence = true;
}
}
if (isAffectedByHourOfPenitence)
{
if (Rnd.get(1, 100) <= DROP_QI_CHANCE)
{
giveItems(event.getAttacker(), CRUMBS_OF_PENITENCE, 1);
if (!qs.isCond(2) && (getQuestItemsCount(event.getAttacker(), CRUMBS_OF_PENITENCE) >= 10))
{
qs.setCond(2, true);
}
}
}
}
}

View File

@ -16,9 +16,6 @@
*/
package quests;
import java.util.logging.Level;
import java.util.logging.Logger;
import quests.Q00013_ParcelDelivery.Q00013_ParcelDelivery;
import quests.Q00015_SweetWhispers.Q00015_SweetWhispers;
import quests.Q00016_TheComingDarkness.Q00016_TheComingDarkness;
@ -131,6 +128,7 @@ import quests.Q00496_IncarnationOfGluttonyKaliosGroup.Q00496_IncarnationOfGlutto
import quests.Q00497_IncarnationOfGreedZellakaSolo.Q00497_IncarnationOfGreedZellakaSolo;
import quests.Q00498_IncarnationOfJealousyPellineSolo.Q00498_IncarnationOfJealousyPellineSolo;
import quests.Q00499_IncarnationOfGluttonyKaliosSolo.Q00499_IncarnationOfGluttonyKaliosSolo;
import quests.Q00500_BrothersBoundInChains.Q00500_BrothersBoundInChains;
import quests.Q00501_ProofOfClanAlliance.Q00501_ProofOfClanAlliance;
import quests.Q00508_AClansReputation.Q00508_AClansReputation;
import quests.Q00509_AClansFame.Q00509_AClansFame;
@ -331,6 +329,9 @@ import quests.Q10813_ForGlory.Q10813_ForGlory;
import quests.Q10814_BefittingOfTheStatus.Q10814_BefittingOfTheStatus;
import quests.Q10815_StepUp.Q10815_StepUp;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* @author NosBit
*/
@ -452,6 +453,7 @@ public class QuestMasterHandler
Q00497_IncarnationOfGreedZellakaSolo.class,
Q00498_IncarnationOfJealousyPellineSolo.class,
Q00499_IncarnationOfGluttonyKaliosSolo.class,
Q00500_BrothersBoundInChains.class,
Q00501_ProofOfClanAlliance.class,
Q00508_AClansReputation.class,
Q00509_AClansFame.class,