Check agathion id at start to avoid further checks.

This commit is contained in:
MobiusDev
2019-02-26 08:14:04 +00:00
parent a916f4be3b
commit da883c20cd
9 changed files with 165 additions and 150 deletions

View File

@@ -52,7 +52,7 @@ public class Q00500_BrothersBoundInChains extends Quest
// Agathion // Agathion
private static final int SIN_EATER = 16098; private static final int SIN_EATER = 16098;
// Others // Others
private static final int DROP_QI_CHANCE = 5; private static final int DROP_CHANCE = 5;
private static final int MIN_LEVEL = 61; private static final int MIN_LEVEL = 61;
public Q00500_BrothersBoundInChains() public Q00500_BrothersBoundInChains()
@@ -182,6 +182,10 @@ public class Q00500_BrothersBoundInChains extends Quest
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -193,14 +197,15 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) startQuestTimer("buff", 2500, null, player);
{
startQuestTimer("buff", 2500, null, player);
}
} }
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -212,11 +217,8 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) cancelQuestTimer("buff", null, player);
{ player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
cancelQuestTimer("buff", null, player);
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
}
} }
@RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@@ -224,7 +226,7 @@ public class Q00500_BrothersBoundInChains extends Quest
public void onAttackableKill(OnAttackableKill event) public void onAttackableKill(OnAttackableKill event)
{ {
final L2PcInstance player = event.getAttacker(); final L2PcInstance player = event.getAttacker();
if (player == null) if ((player == null) || (player.getAgathionId() != SIN_EATER) || !player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE))
{ {
return; return;
} }
@@ -234,8 +236,9 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE) && (getRandom(100) < DROP_QI_CHANCE)) if (getRandom(100) < DROP_CHANCE)
{ {
// Player can drop more than 10 Crumbs of Penitence but there's no point in getting more than 10 (retail).
giveItems(player, CRUMBS_OF_PENITENCE, 1); giveItems(player, CRUMBS_OF_PENITENCE, 1);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10)) if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10))
{ {

View File

@@ -52,7 +52,7 @@ public class Q00500_BrothersBoundInChains extends Quest
// Agathion // Agathion
private static final int SIN_EATER = 16098; private static final int SIN_EATER = 16098;
// Others // Others
private static final int DROP_QI_CHANCE = 5; private static final int DROP_CHANCE = 5;
private static final int MIN_LEVEL = 61; private static final int MIN_LEVEL = 61;
public Q00500_BrothersBoundInChains() public Q00500_BrothersBoundInChains()
@@ -182,6 +182,10 @@ public class Q00500_BrothersBoundInChains extends Quest
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -193,14 +197,15 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) startQuestTimer("buff", 2500, null, player);
{
startQuestTimer("buff", 2500, null, player);
}
} }
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -212,11 +217,8 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) cancelQuestTimer("buff", null, player);
{ player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
cancelQuestTimer("buff", null, player);
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
}
} }
@RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@@ -224,7 +226,7 @@ public class Q00500_BrothersBoundInChains extends Quest
public void onAttackableKill(OnAttackableKill event) public void onAttackableKill(OnAttackableKill event)
{ {
final L2PcInstance player = event.getAttacker(); final L2PcInstance player = event.getAttacker();
if (player == null) if ((player == null) || (player.getAgathionId() != SIN_EATER) || !player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE))
{ {
return; return;
} }
@@ -234,8 +236,9 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE) && (getRandom(100) < DROP_QI_CHANCE)) if (getRandom(100) < DROP_CHANCE)
{ {
// Player can drop more than 10 Crumbs of Penitence but there's no point in getting more than 10 (retail).
giveItems(player, CRUMBS_OF_PENITENCE, 1); giveItems(player, CRUMBS_OF_PENITENCE, 1);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10)) if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10))
{ {

View File

@@ -52,7 +52,7 @@ public class Q00500_BrothersBoundInChains extends Quest
// Agathion // Agathion
private static final int SIN_EATER = 16098; private static final int SIN_EATER = 16098;
// Others // Others
private static final int DROP_QI_CHANCE = 5; private static final int DROP_CHANCE = 5;
private static final int MIN_LEVEL = 85; private static final int MIN_LEVEL = 85;
public Q00500_BrothersBoundInChains() public Q00500_BrothersBoundInChains()
@@ -182,6 +182,10 @@ public class Q00500_BrothersBoundInChains extends Quest
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -193,14 +197,15 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) startQuestTimer("buff", 2500, null, player);
{
startQuestTimer("buff", 2500, null, player);
}
} }
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -212,11 +217,8 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) cancelQuestTimer("buff", null, player);
{ player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
cancelQuestTimer("buff", null, player);
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
}
} }
@RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@@ -224,7 +226,7 @@ public class Q00500_BrothersBoundInChains extends Quest
public void onAttackableKill(OnAttackableKill event) public void onAttackableKill(OnAttackableKill event)
{ {
final L2PcInstance player = event.getAttacker(); final L2PcInstance player = event.getAttacker();
if (player == null) if ((player == null) || (player.getAgathionId() != SIN_EATER) || !player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE))
{ {
return; return;
} }
@@ -234,8 +236,9 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE) && (getRandom(100) < DROP_QI_CHANCE)) if (getRandom(100) < DROP_CHANCE)
{ {
// Player can drop more than 10 Crumbs of Penitence but there's no point in getting more than 10 (retail).
giveItems(player, CRUMBS_OF_PENITENCE, 1); giveItems(player, CRUMBS_OF_PENITENCE, 1);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10)) if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10))
{ {

View File

@@ -52,7 +52,7 @@ public class Q00500_BrothersBoundInChains extends Quest
// Agathion // Agathion
private static final int SIN_EATER = 16098; private static final int SIN_EATER = 16098;
// Others // Others
private static final int DROP_QI_CHANCE = 5; private static final int DROP_CHANCE = 5;
private static final int MIN_LEVEL = 85; private static final int MIN_LEVEL = 85;
public Q00500_BrothersBoundInChains() public Q00500_BrothersBoundInChains()
@@ -182,6 +182,10 @@ public class Q00500_BrothersBoundInChains extends Quest
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -193,14 +197,15 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) startQuestTimer("buff", 2500, null, player);
{
startQuestTimer("buff", 2500, null, player);
}
} }
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -212,11 +217,8 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) cancelQuestTimer("buff", null, player);
{ player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
cancelQuestTimer("buff", null, player);
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
}
} }
@RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@@ -224,7 +226,7 @@ public class Q00500_BrothersBoundInChains extends Quest
public void onAttackableKill(OnAttackableKill event) public void onAttackableKill(OnAttackableKill event)
{ {
final L2PcInstance player = event.getAttacker(); final L2PcInstance player = event.getAttacker();
if (player == null) if ((player == null) || (player.getAgathionId() != SIN_EATER) || !player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE))
{ {
return; return;
} }
@@ -234,8 +236,9 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE) && (getRandom(100) < DROP_QI_CHANCE)) if (getRandom(100) < DROP_CHANCE)
{ {
// Player can drop more than 10 Crumbs of Penitence but there's no point in getting more than 10 (retail).
giveItems(player, CRUMBS_OF_PENITENCE, 1); giveItems(player, CRUMBS_OF_PENITENCE, 1);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10)) if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10))
{ {

View File

@@ -52,7 +52,7 @@ public class Q00500_BrothersBoundInChains extends Quest
// Agathion // Agathion
private static final int SIN_EATER = 16098; private static final int SIN_EATER = 16098;
// Others // Others
private static final int DROP_QI_CHANCE = 5; private static final int DROP_CHANCE = 5;
private static final int MIN_LEVEL = 85; private static final int MIN_LEVEL = 85;
public Q00500_BrothersBoundInChains() public Q00500_BrothersBoundInChains()
@@ -182,6 +182,10 @@ public class Q00500_BrothersBoundInChains extends Quest
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -193,14 +197,15 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) startQuestTimer("buff", 2500, null, player);
{
startQuestTimer("buff", 2500, null, player);
}
} }
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -212,11 +217,8 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) cancelQuestTimer("buff", null, player);
{ player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
cancelQuestTimer("buff", null, player);
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
}
} }
@RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@@ -224,7 +226,7 @@ public class Q00500_BrothersBoundInChains extends Quest
public void onAttackableKill(OnAttackableKill event) public void onAttackableKill(OnAttackableKill event)
{ {
final L2PcInstance player = event.getAttacker(); final L2PcInstance player = event.getAttacker();
if (player == null) if ((player == null) || (player.getAgathionId() != SIN_EATER) || !player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE))
{ {
return; return;
} }
@@ -234,8 +236,9 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE) && (getRandom(100) < DROP_QI_CHANCE)) if (getRandom(100) < DROP_CHANCE)
{ {
// Player can drop more than 10 Crumbs of Penitence but there's no point in getting more than 10 (retail).
giveItems(player, CRUMBS_OF_PENITENCE, 1); giveItems(player, CRUMBS_OF_PENITENCE, 1);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10)) if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10))
{ {

View File

@@ -52,7 +52,7 @@ public class Q00500_BrothersBoundInChains extends Quest
// Agathion // Agathion
private static final int SIN_EATER = 16098; private static final int SIN_EATER = 16098;
// Others // Others
private static final int DROP_QI_CHANCE = 5; private static final int DROP_CHANCE = 5;
private static final int MIN_LEVEL = 85; private static final int MIN_LEVEL = 85;
public Q00500_BrothersBoundInChains() public Q00500_BrothersBoundInChains()
@@ -182,6 +182,10 @@ public class Q00500_BrothersBoundInChains extends Quest
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -193,14 +197,15 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) startQuestTimer("buff", 2500, null, player);
{
startQuestTimer("buff", 2500, null, player);
}
} }
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -212,11 +217,8 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) cancelQuestTimer("buff", null, player);
{ player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
cancelQuestTimer("buff", null, player);
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
}
} }
@RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@@ -224,7 +226,7 @@ public class Q00500_BrothersBoundInChains extends Quest
public void onAttackableKill(OnAttackableKill event) public void onAttackableKill(OnAttackableKill event)
{ {
final L2PcInstance player = event.getAttacker(); final L2PcInstance player = event.getAttacker();
if (player == null) if ((player == null) || (player.getAgathionId() != SIN_EATER) || !player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE))
{ {
return; return;
} }
@@ -234,8 +236,9 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE) && (getRandom(100) < DROP_QI_CHANCE)) if (getRandom(100) < DROP_CHANCE)
{ {
// Player can drop more than 10 Crumbs of Penitence but there's no point in getting more than 10 (retail).
giveItems(player, CRUMBS_OF_PENITENCE, 1); giveItems(player, CRUMBS_OF_PENITENCE, 1);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10)) if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 10))
{ {

View File

@@ -183,6 +183,10 @@ public class Q00500_BrothersBoundInChains extends Quest
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -194,14 +198,15 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) startQuestTimer("buff", 2500, null, player);
{
startQuestTimer("buff", 2500, null, player);
}
} }
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -213,11 +218,8 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) cancelQuestTimer("buff", null, player);
{ player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
cancelQuestTimer("buff", null, player);
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
}
} }
@RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@@ -225,7 +227,7 @@ public class Q00500_BrothersBoundInChains extends Quest
public void onAttackableKill(OnAttackableKill event) public void onAttackableKill(OnAttackableKill event)
{ {
final L2PcInstance player = event.getAttacker(); final L2PcInstance player = event.getAttacker();
if (player == null) if ((player == null) || (player.getAgathionId() != SIN_EATER) || !player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE))
{ {
return; return;
} }
@@ -254,25 +256,22 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE)) // The quest item drops from every 20th mob you kill, in total you need to kill 700 mobs.
final int killCount = qs.getInt(KILL_COUNT_VAR);
if (killCount >= 20)
{ {
// The quest item drops from every 20th mob you kill, in total you need to kill 700 mobs. // Player can drop more than 35 Crumbs of Penitence but there's no point in getting more than 35 (retail).
final int killCount = qs.getInt(KILL_COUNT_VAR); giveItems(player, CRUMBS_OF_PENITENCE, 1);
if (killCount >= 20) qs.set(KILL_COUNT_VAR, 0);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 35))
{ {
// Player can drop more than 35 Crumbs of Penitence but there's no point in getting more than 35 (retail) qs.setCond(2, true);
giveItems(player, CRUMBS_OF_PENITENCE, 1);
qs.set(KILL_COUNT_VAR, 0);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 35))
{
qs.setCond(2, true);
}
}
else
{
qs.set(KILL_COUNT_VAR, killCount + 1);
} }
} }
else
{
qs.set(KILL_COUNT_VAR, killCount + 1);
}
} }
} }

View File

@@ -183,6 +183,10 @@ public class Q00500_BrothersBoundInChains extends Quest
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -194,14 +198,15 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) startQuestTimer("buff", 2500, null, player);
{
startQuestTimer("buff", 2500, null, player);
}
} }
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -213,11 +218,8 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) cancelQuestTimer("buff", null, player);
{ player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
cancelQuestTimer("buff", null, player);
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
}
} }
@RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@@ -225,7 +227,7 @@ public class Q00500_BrothersBoundInChains extends Quest
public void onAttackableKill(OnAttackableKill event) public void onAttackableKill(OnAttackableKill event)
{ {
final L2PcInstance player = event.getAttacker(); final L2PcInstance player = event.getAttacker();
if (player == null) if ((player == null) || (player.getAgathionId() != SIN_EATER) || !player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE))
{ {
return; return;
} }
@@ -254,25 +256,22 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE)) // The quest item drops from every 20th mob you kill, in total you need to kill 700 mobs.
final int killCount = qs.getInt(KILL_COUNT_VAR);
if (killCount >= 20)
{ {
// The quest item drops from every 20th mob you kill, in total you need to kill 700 mobs. // Player can drop more than 35 Crumbs of Penitence but there's no point in getting more than 35 (retail).
final int killCount = qs.getInt(KILL_COUNT_VAR); giveItems(player, CRUMBS_OF_PENITENCE, 1);
if (killCount >= 20) qs.set(KILL_COUNT_VAR, 0);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 35))
{ {
// Player can drop more than 35 Crumbs of Penitence but there's no point in getting more than 35 (retail) qs.setCond(2, true);
giveItems(player, CRUMBS_OF_PENITENCE, 1);
qs.set(KILL_COUNT_VAR, 0);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 35))
{
qs.setCond(2, true);
}
}
else
{
qs.set(KILL_COUNT_VAR, killCount + 1);
} }
} }
else
{
qs.set(KILL_COUNT_VAR, killCount + 1);
}
} }
} }

View File

@@ -183,6 +183,10 @@ public class Q00500_BrothersBoundInChains extends Quest
private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event) private void OnPlayerSummonAgathion(OnPlayerSummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -194,14 +198,15 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) startQuestTimer("buff", 2500, null, player);
{
startQuestTimer("buff", 2500, null, player);
}
} }
private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event) private void OnPlayerUnsummonAgathion(OnPlayerUnsummonAgathion event)
{ {
if (event.getAgathionId() != SIN_EATER)
{
return;
}
final L2PcInstance player = event.getPlayer(); final L2PcInstance player = event.getPlayer();
if (player == null) if (player == null)
{ {
@@ -213,11 +218,8 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (event.getAgathionId() == SIN_EATER) cancelQuestTimer("buff", null, player);
{ player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
cancelQuestTimer("buff", null, player);
player.getEffectList().stopSkillEffects(true, HOUR_OF_PENITENCE);
}
} }
@RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterEvent(EventType.ON_ATTACKABLE_KILL)
@@ -225,7 +227,7 @@ public class Q00500_BrothersBoundInChains extends Quest
public void onAttackableKill(OnAttackableKill event) public void onAttackableKill(OnAttackableKill event)
{ {
final L2PcInstance player = event.getAttacker(); final L2PcInstance player = event.getAttacker();
if (player == null) if ((player == null) || (player.getAgathionId() != SIN_EATER) || !player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE))
{ {
return; return;
} }
@@ -254,25 +256,22 @@ public class Q00500_BrothersBoundInChains extends Quest
return; return;
} }
if (player.getEffectList().isAffectedBySkill(HOUR_OF_PENITENCE)) // The quest item drops from every 20th mob you kill, in total you need to kill 700 mobs.
final int killCount = qs.getInt(KILL_COUNT_VAR);
if (killCount >= 20)
{ {
// The quest item drops from every 20th mob you kill, in total you need to kill 700 mobs. // Player can drop more than 35 Crumbs of Penitence but there's no point in getting more than 35 (retail).
final int killCount = qs.getInt(KILL_COUNT_VAR); giveItems(player, CRUMBS_OF_PENITENCE, 1);
if (killCount >= 20) qs.set(KILL_COUNT_VAR, 0);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 35))
{ {
// Player can drop more than 35 Crumbs of Penitence but there's no point in getting more than 35 (retail) qs.setCond(2, true);
giveItems(player, CRUMBS_OF_PENITENCE, 1);
qs.set(KILL_COUNT_VAR, 0);
if (!qs.isCond(2) && (getQuestItemsCount(player, CRUMBS_OF_PENITENCE) >= 35))
{
qs.setCond(2, true);
}
}
else
{
qs.set(KILL_COUNT_VAR, killCount + 1);
} }
} }
else
{
qs.set(KILL_COUNT_VAR, killCount + 1);
}
} }
} }