public String onTalk(L2NpcInstance npc, QuestState st)
{
int _state = st.getState();
int npcId = npc.getNpcId();
int cond = st.getInt("cond");
L2ItemInstance dragonflute = GetDragonflute(st);
int dragonflute_id = st.getInt("dragonflute");
if(_state == CREATED)
{
if(npcId != Cronos)
{
return "noquest";
}
if(st.getPlayer().getLevel() < 45)
{
st.exitCurrentQuest(true);
return "30610_01.htm";
}
if(dragonflute == null)
{
st.exitCurrentQuest(true);
return "30610_02.htm";
}
if(dragonflute.getEnchantLevel() < 55)
{
st.exitCurrentQuest(true);
return "30610_03.htm";
}
st.set("cond", "0");
st.set("dragonflute", String.valueOf(dragonflute.getObjectId()));
return "30610_04.htm";
}
if(_state != STARTED)
{
return "noquest";
}
if(npcId == Cronos)
{
if(dragonflute == null)
{
return "30610_02.htm";
}
return dragonflute.getObjectId() == dragonflute_id ? "30610_07.htm" : "30610_06.htm";
}
if(npcId == Mimyu)
{
if(st.getQuestItemsCount(Dragon_Bugle_of_Wind) + st.getQuestItemsCount(Dragon_Bugle_of_Star) + st.getQuestItemsCount(Dragon_Bugle_of_Twilight) > 0)
{
return "30747_00b.htm";
}
if(dragonflute == null)
{
return "noquest";
}
if(cond == 1)
{
return "30747_01.htm";
}
if(cond == 2)
{
if(!HatchlingSummoned(st, false))
{
return "30747_09.htm";
}
if(st.getQuestItemsCount(Fairy_Leaf) == 0)
{
st.playSound(SOUND_FINISH);
st.exitCurrentQuest(true);
return "30747_11.htm";
}
return "30747_10.htm";
}
if(cond == 3)
{
if(dragonflute.getObjectId() != dragonflute_id)
{
return "30747_00a.htm";
}
if(st.getQuestItemsCount(Fairy_Leaf) > 0)
{
st.playSound(SOUND_FINISH);
st.exitCurrentQuest(true);
return "30747_11.htm";
}
if(!(CheckTree(st, Fairy_Tree_of_Wind) && CheckTree(st, Fairy_Tree_of_Star) && CheckTree(st, Fairy_Tree_of_Twilight) && CheckTree(st, Fairy_Tree_of_Abyss)))
{
st.playSound(SOUND_FINISH);
st.exitCurrentQuest(true);
return "30747_11.htm";
}
if(st.getInt("welldone") == 0)
{
if(!HatchlingSummoned(st, false))
{
return "30747_09.htm";
}
st.set("welldone", "1");
return "30747_12.htm";
}
if(HatchlingSummoned(st, false) || st.getPlayer().getPet() != null)
{
return "30747_13a.htm";
}
dragonflute.setItemId(Dragon_Bugle_of_Wind + dragonflute.getItemId() - Dragonflute_of_Wind);
dragonflute.updateDatabase(true, true);
st.getPlayer().sendPacket(new ItemList(st.getPlayer(), false));
st.playSound(SOUND_FINISH);
st.exitCurrentQuest(true);
return "30747_13.htm";
}