예제 #1
0
 @Override
 public String onEvent(String event, QuestState st, NpcInstance npc) {
   String htmltext = event;
   int cond = st.getCond();
   if (event.equalsIgnoreCase("take_test") && cond == 0) {
     QuestState GoodDayToFly = st.getPlayer().getQuestState(_10273_GoodDayToFly.class);
     if (GoodDayToFly != null && GoodDayToFly.isCompleted()) {
       st.setCond(2);
       st.setState(STARTED);
       st.playSound(SOUND_ACCEPT);
       htmltext = "dilios_q692_4.htm";
     } else {
       st.setCond(1);
       st.setState(STARTED);
       st.playSound(SOUND_ACCEPT);
       htmltext = "dilios_q692_3.htm";
     }
   } else if (event.equalsIgnoreCase("lekon_q692_2.htm") && cond == 1) {
     st.exitCurrentQuest(true);
   } else if (event.equalsIgnoreCase("kutran_q692_2.htm") && cond == 2) {
     st.setCond(3);
     st.playSound(SOUND_MIDDLE);
   } else if (event.equalsIgnoreCase("exchange_sod") && cond == 3) {
     if (st.getQuestItemsCount(FleetSteedTroupsTotem) < 5) {
       htmltext = "kutran_q692_7.htm";
     } else {
       int _charmstogive = Math.round(st.getQuestItemsCount(FleetSteedTroupsTotem) / 5);
       st.takeItems(FleetSteedTroupsTotem, 5 * _charmstogive);
       st.giveItems(FleetSteedTroupsCharm, _charmstogive);
       htmltext = "kutran_q692_4.htm";
     }
   } else if (event.equalsIgnoreCase("exchange_soi") && cond == 3) {
     if (st.getQuestItemsCount(NucleusofanIncompleteSoul) < 5) {
       htmltext = "kutran_q692_7.htm";
     } else {
       int _soulstogive = Math.round(st.getQuestItemsCount(NucleusofanIncompleteSoul) / 5);
       st.takeItems(NucleusofanIncompleteSoul, 5 * _soulstogive);
       st.giveItems(NucleusofaFreedSoul, _soulstogive);
       htmltext = "kutran_q692_5.htm";
     }
   } else if (event.equalsIgnoreCase("exchange_soa") && cond == 3) {
     if (st.getQuestItemsCount(SpiritStoneDust) < 5) {
       htmltext = "kutran_q692_7.htm";
     } else {
       int _soulstogive = Math.round(st.getQuestItemsCount(SpiritStoneDust) / 5);
       st.takeItems(SpiritStoneDust, 5 * _soulstogive);
       st.giveItems(SpiritStoneFragment, _soulstogive);
       htmltext = "kutran_q692_5.htm";
     }
   } else if (event.equalsIgnoreCase("exchange_breath") && cond == 3) {
     if (st.getQuestItemsCount(BreathofTiat) == 0) {
       htmltext = "kutran_q692_7.htm";
     } else {
       st.giveItems(ADENA_ID, st.getQuestItemsCount(BreathofTiat) * 2500);
       st.takeItems(BreathofTiat, -1);
       htmltext = "kutran_q692_5.htm";
     }
   } else if (event.equalsIgnoreCase("exchange_portion") && cond == 3) {
     if (st.getQuestItemsCount(PortionofaSoul) == 0) {
       htmltext = "kutran_q692_7.htm";
     } else {
       st.giveItems(ADENA_ID, st.getQuestItemsCount(PortionofaSoul) * 2500);
       st.takeItems(PortionofaSoul, -1);
       htmltext = "kutran_q692_5.htm";
     }
   } else if (event.equalsIgnoreCase("exchange_energy") && cond == 3) {
     if (st.getQuestItemsCount(ConcentratedSpiritEnergy) == 0) {
       htmltext = "kutran_q692_7.htm";
     } else {
       st.giveItems(ADENA_ID, st.getQuestItemsCount(ConcentratedSpiritEnergy) * 25000);
       st.takeItems(ConcentratedSpiritEnergy, -1);
       htmltext = "kutran_q692_5.htm";
     }
   }
   return htmltext;
 }