if ((st.getPlayer() == null) || (st.getPlayer().getClan() == null))
{
st.exitCurrentQuest(true);
return htmltext;
}
QuestState leader = getLeader(st);
if (leader == null)
{
removeQuestFromMembers(st, true);
return "Quest Failed";
}
int npcId = npc.getNpcId();
if (npcId == SIR_KRISTOF_RODEMAI)
{
if (!st.getPlayer().isClanLeader())
{
st.exitCurrentQuest(true);
return "30756-10.htm";
}
else if (st.getPlayer().getClan().getLevel() <= 2)
{
st.exitCurrentQuest(true);
return "30756-08.htm";
}
else if (st.getPlayer().getClan().getLevel() >= 4)
{
st.exitCurrentQuest(true);
return "30756-09.htm";
}
else if (st.getQuestItemsCount(VOUCHER_OF_FAITH) > 0)
{
st.playSound(SOUND_FANFARE2);
st.takeItems(VOUCHER_OF_FAITH, -1);
st.giveItems(PROOF_OF_ALLIANCE, 1);
st.addExpAndSp(0, 120000);
htmltext = "30756-07.htm";
st.exitCurrentQuest(true);
}
else if ((cond == 1) || (cond == 2))
{
return "30756-06.htm";
}
else if (st.getQuestItemsCount(PROOF_OF_ALLIANCE) == 0)
{
st.setCond(0);
return "30756-01.htm";
}
else
{
st.exitCurrentQuest(true);
return htmltext;
}
}
else if (npcId == WITCH_KALIS)
{
if (st.getPlayer().isClanLeader())
{
if (cond == 1)
{
return "30759-01.htm";
}
else if (cond == 2)
{
htmltext = "30759-05.htm";
if (st.getQuestItemsCount(SYMBOL_OF_LOYALTY) == 3)
{
int deads = 0;
try
{
deads = st.get("dead_list").split(" ").length;
}
finally
{
if (deads == 3)
{
htmltext = "30759-06.htm";
}
}
}
}
else if (cond == 3)
{
if ((st.getQuestItemsCount(HERB_OF_HARIT) > 0) && (st.getQuestItemsCount(HERB_OF_VANOR) > 0) && (st.getQuestItemsCount(HERB_OF_OEL_MAHUM) > 0) && (st.getQuestItemsCount(BLOOD_OF_EVA) > 0) && (st.getQuestItemsCount(ANTIDOTE_RECIPE) > 0))
{
st.takeItems(ANTIDOTE_RECIPE, 1);
st.takeItems(HERB_OF_HARIT, 1);
st.takeItems(HERB_OF_VANOR, 1);
st.takeItems(HERB_OF_OEL_MAHUM, 1);
st.takeItems(BLOOD_OF_EVA, 1);
st.giveItems(POTION_OF_RECOVERY, 1);
st.giveItems(VOUCHER_OF_FAITH, 1);
st.cancelQuestTimer("poison_timer");
removeQuestFromMembers(st, false);
st.getPlayer().stopImmobilized();
st.getPlayer().getEffectList().stopEffect(4082);
st.setCond(4);
st.playSound(SOUND_FINISH);
return "30759-08.htm";
}
else if (st.getQuestItemsCount(VOUCHER_OF_FAITH) == 0)
{
return "30759-10.htm";
}
}
}
else if (leader.getCond() == 3)
{
return "30759-11.htm";
}
}
else if (npcId == STATUE_OF_OFFERING)
{
if (st.getPlayer().isClanLeader())
{
return "30757-03.htm";
}
else if (st.getPlayer().getLevel() <= 39)
{
st.exitCurrentQuest(true);
return "30757-02.htm";
}
else
{
String[] dlist;
int deads;
try
{
dlist = leader.get("dead_list").split(" ");
deads = dlist.length;
}
catch (Exception e)
{
removeQuestFromMembers(st, true);
return "Who are you?";
}
if (deads < 3)
{
for (String str : dlist)
{
if (st.getPlayer().getName().equalsIgnoreCase(str))
{
return "you cannot die again!";
}
}
return "30757-01.htm";
}
}
}
else if (npcId == WITCH_ATHREA)
{
if (st.getPlayer().isClanLeader())
{
return "30757-03.htm";
}
String[] dlist;
try
{
dlist = leader.get("dead_list").split(" ");
}
catch (Exception e)
{
st.exitCurrentQuest(true);
return "Who are you?";
}
Boolean flag = false;
if (dlist != null)
{
for (String str : dlist)
{
if (st.getPlayer().getName().equalsIgnoreCase(str))
{
flag = true;
}
}
}
if (!flag)
{
st.exitCurrentQuest(true);
return "Who are you?";
}
int game_state = leader.getInt("chest_game");
if (game_state == 0)
{
if (leader.getInt("chest_try") == 0)
{
return "30758-01.htm";
}
return "30758-05.htm";
}
else if (game_state == 1)
{
return "30758-09.htm";
}
else if (game_state == 2)
{
st.playSound(SOUND_FINISH);
st.giveItems(BLOOD_OF_EVA, 1);
st.cancelQuestTimer("chest_timer");
stop_chest_game(st);
leader.set("chest_game", "3");
return "30758-08.htm";
}
}
return htmltext;
}