|
|
|
@@ -16,23 +16,27 @@
|
|
|
|
|
*/
|
|
|
|
|
package quests.Q00500_BrothersBoundInChains;
|
|
|
|
|
|
|
|
|
|
import com.l2jmobius.commons.util.Rnd;
|
|
|
|
|
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
|
|
|
|
|
import com.l2jmobius.gameserver.enums.QuestType;
|
|
|
|
|
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
|
|
|
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
|
|
|
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
|
|
|
|
import com.l2jmobius.gameserver.model.events.Containers;
|
|
|
|
|
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.events.impl.character.player.OnPlayerSummonAgathion;
|
|
|
|
|
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerUnsummonAgathion;
|
|
|
|
|
import com.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener;
|
|
|
|
|
import com.l2jmobius.gameserver.model.quest.Quest;
|
|
|
|
|
import com.l2jmobius.gameserver.model.quest.QuestState;
|
|
|
|
|
import com.l2jmobius.gameserver.model.quest.State;
|
|
|
|
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Brothers Bound in Chains (500)
|
|
|
|
|
* @author Mobius (Based on GoD quest.)
|
|
|
|
|
* @URL https://l2wiki.com/classic/Brothers_Bound_in_Chains
|
|
|
|
|
*/
|
|
|
|
@@ -45,7 +49,7 @@ public class Q00500_BrothersBoundInChains extends Quest
|
|
|
|
|
private static final int PENITENT_MANACLES = 70806;
|
|
|
|
|
private static final int CRUMBS_OF_PENITENCE = 70807;
|
|
|
|
|
// Skill
|
|
|
|
|
private static final int HOUR_OF_PENITENCE = 15325;
|
|
|
|
|
private static final int HOUR_OF_PENITENCE = 55702;
|
|
|
|
|
// Agathion
|
|
|
|
|
private static final int SIN_EATER = 9021;
|
|
|
|
|
// Other
|
|
|
|
@@ -56,8 +60,10 @@ public class Q00500_BrothersBoundInChains extends Quest
|
|
|
|
|
super(500);
|
|
|
|
|
addStartNpc(DARK_JUDGE);
|
|
|
|
|
addTalkId(DARK_JUDGE);
|
|
|
|
|
addSummonAgathion();
|
|
|
|
|
registerQuestItems(PENITENT_MANACLES, CRUMBS_OF_PENITENCE);
|
|
|
|
|
|
|
|
|
|
Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_SUMMON_AGATHION, (OnPlayerSummonAgathion event) -> OnPlayerSummonAgathion(event), this));
|
|
|
|
|
Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_UNSUMMON_AGATHION, (OnPlayerUnsummonAgathion event) -> OnPlayerUnsummonAgathion(event), this));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@@ -73,7 +79,7 @@ public class Q00500_BrothersBoundInChains extends Quest
|
|
|
|
|
{
|
|
|
|
|
case "buff":
|
|
|
|
|
{
|
|
|
|
|
if (player != null)
|
|
|
|
|
if ((player != null) && (player.getAgathionId() == SIN_EATER))
|
|
|
|
|
{
|
|
|
|
|
final Skill skill = SkillData.getInstance().getSkill(HOUR_OF_PENITENCE, 1); // Hour of Penitence
|
|
|
|
|
skill.activateSkill(player, player);
|
|
|
|
@@ -109,7 +115,8 @@ public class Q00500_BrothersBoundInChains extends Quest
|
|
|
|
|
if (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 35)
|
|
|
|
|
{
|
|
|
|
|
takeItems(player, CRUMBS_OF_PENITENCE, -1);
|
|
|
|
|
player.setPkKills(Math.max(0, player.getPkKills() - Rnd.get(1, 3)));
|
|
|
|
|
takeItems(player, PENITENT_MANACLES, -1);
|
|
|
|
|
player.setPkKills(Math.max(0, player.getPkKills() - getRandom(1, 3)));
|
|
|
|
|
qs.unset(KILL_COUNT_VAR);
|
|
|
|
|
qs.exitQuest(QuestType.DAILY, true);
|
|
|
|
|
}
|
|
|
|
@@ -174,15 +181,45 @@ public class Q00500_BrothersBoundInChains extends Quest
|
|
|
|
|
return htmltext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onSummonAgathion(L2PcInstance player, int agathionId)
|
|
|
|
|
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
|
|
|
|
|
{
|
|
|
|
|
if (SIN_EATER == agathionId)
|
|
|
|
|
final L2PcInstance player = event.getPlayer();
|
|
|
|
|
if (player == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
final QuestState qs = getQuestState(player, false);
|
|
|
|
|
if (qs == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (event.getAgathionId() == SIN_EATER)
|
|
|
|
|
{
|
|
|
|
|
startQuestTimer("buff", 2500, null, player);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
|
|
|
|
|
{
|
|
|
|
|
final L2PcInstance player = event.getPlayer();
|
|
|
|
|
if (player == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
final QuestState qs = getQuestState(player, false);
|
|
|
|
|
if (qs == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (event.getAgathionId() == SIN_EATER)
|
|
|
|
|
{
|
|
|
|
|
cancelQuestTimer("buff", null, player);
|
|
|
|
|
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RegisterEvent(EventType.ON_ATTACKABLE_KILL)
|
|
|
|
|
@RegisterType(ListenerRegisterType.GLOBAL_MONSTERS)
|
|
|
|
|
public void onAttackableKill(OnAttackableKill event)
|
|
|
|
|