Смотри, при взятии квеста у тебя выставляет конд = 1 и стейт квест как STARTED. Тут всё верно, но дальше в обработке разговора с нпс, ты указываешь cond == 0, что уже не может быть. А первоначальный диалог с нпс, обрабатывается не по конду, а по стейту CREATED =)
Свернуть ↑
Код:
@Override
public String onEvent(String event, QuestState qs, L2NpcInstance npc)
{
String htmltext = "noquest";
if(event.equalsIgnoreCase("31540-02.htm"))
{
qs.setCond(1);
qs.setState(STARTED);
qs.playSound(SOUND_ACCEPT);
}
return htmltext;
}
@Override
public String onTalk(L2NpcInstance npc, QuestState st)
{
String htmltext = "noquest";
int npcId = npc.getNpcId();
int cond = st.getCond();
int id = st.getState();
if(id == CREATED)
if(npcId == Klein)
if(st.getPlayer().getLevel() == 1)
{
st.exitCurrentQuest(true);
htmltext = "31540-nolevel.htm";
}
else
htmltext = "31540-01.htm";
else if(id == STARTED)
if(npcId == Klein)
if(cond == 1)
htmltext = "31540-03.htm";
else if(cond == 2)
{
st.getPlayer().addExpAndSp((5672), (446), false, false);
st.exitCurrentQuest(false);
htmltext = "31540-04.htm";
}
return htmltext;
}
Свернуть ↑Развернуть ↓
Только не пойму одного, как он получит награду если cond нигде не меняется на 2ой?