removeQuestFromMembers(st, true);
return "Quest Failed";
}
// first part, general checking
int npcId = npc.getNpcId();
QuestTimer timer = leader.getQuestTimer("poison_timer");
if(timer == null)
{
stop_chest_game(st);
return "Quest Failed";
}
// second part, herbs gathering
for(int[] m : MOBS)
{
if(npcId == m[0] && st.getInt(String.valueOf(m[1])) == 0)
{
if(Rnd.chance(RATE))
{
st.giveItems(m[1], 1);
leader.set(String.valueOf(m[1]), "1");
st.playSound(SOUND_MIDDLE);
return null;
}
}
}
// third part, chest game
for(int i : CHESTS)
{
if(npcId == i)
{
timer = leader.getQuestTimer("chest_timer");
if(timer == null)
{
stop_chest_game(st);
return "Time is up!";
}
if(Rnd.chance(25))
{
Functions.npcSay(npc, "###### BINGO! ######");
int count = leader.getInt("chest_count");
if(count < 4)
{
count += 1;
leader.set("chest_count", String.valueOf(count));
}
if(count >= 4)
{
stop_chest_game(st);
leader.set("chest_game", "2");
timer.cancel();
st.playSound(SOUND_MIDDLE);
}
else
{
st.playSound(SOUND_ITEMGET);