コード例 #1
0
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState qs = getQuestState(player, true);
   String htmltext = getNoQuestMsg(player);
   if (qs.isCreated() || qs.isCompleted()) {
     if (npc.getId() == MASTER_VIRGIL) {
       htmltext = "30329-01.htm";
     }
   } else if (qs.isStarted()) {
     switch (npc.getId()) {
       case MASTER_VIRGIL:
         {
           if (hasQuestItems(player, PALLUS_TALISMAN)) {
             if (!hasQuestItems(player, LYCANTHROPE_SKULL)) {
               htmltext = "30329-07.html";
             } else if (hasQuestItems(player, LYCANTHROPE_SKULL)
                 && (getQuestItemsCount(player, LYCANTHROPE_SKULL) < 13)) {
               htmltext = "30329-08.html";
             } else {
               htmltext = "30329-09.html";
             }
           } else if (hasQuestItems(player, COFFIN_OF_ETERNAL_REST)) {
             giveAdena(player, 163800, true);
             giveItems(player, GAZE_OF_ABYSS, 1);
             final int level = player.getLevel();
             if (level >= 20) {
               addExpAndSp(player, 320534, 26212);
             } else if (level == 19) {
               addExpAndSp(player, 456128, 32910);
             } else {
               addExpAndSp(player, 591724, 39608);
             }
             qs.exitQuest(false, true);
             player.sendPacket(new SocialAction(player.getObjectId(), 3));
             qs.saveGlobalQuestVar("1ClassQuestFinished", "1");
             htmltext = "30329-11.html";
           } else if (hasAtLeastOneQuestItem(player, VIRGILS_LETTER, MORTE_TALISMAN)) {
             htmltext = "30329-12.html";
           }
           break;
         }
       case KALINTA:
         {
           if (hasQuestItems(player, VIRGILS_LETTER)) {
             htmltext = "30422-01.html";
           } else if (hasQuestItems(player, MORTE_TALISMAN)) {
             if (!hasQuestItems(player, ARACHNID_TRACKER_SILK, VENOMOUS_SPIDERS_CARAPACE)) {
               htmltext = "30422-03.html";
             } else if (!hasQuestItems(player, ARACHNID_TRACKER_SILK)
                 && hasQuestItems(player, VENOMOUS_SPIDERS_CARAPACE)) {
               htmltext = "30422-04.html";
             } else if ((getQuestItemsCount(player, ARACHNID_TRACKER_SILK) >= 5)
                 && hasQuestItems(player, VENOMOUS_SPIDERS_CARAPACE)) {
               htmltext = "30422-05.html";
             } else if (hasQuestItems(player, ARACHNID_TRACKER_SILK, VENOMOUS_SPIDERS_CARAPACE)) {
               htmltext = "30422-04.html";
             }
           } else if (hasQuestItems(player, COFFIN_OF_ETERNAL_REST)) {
             htmltext = "30422-06.html";
           }
           break;
         }
     }
   }
   return htmltext;
 }
コード例 #2
0
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState qs = getQuestState(player, true);
   String htmltext = getNoQuestMsg(player);
   if (qs.isCreated() || qs.isCompleted()) {
     if (npc.getId() == PRIEST_MANUEL) {
       if (!hasQuestItems(player, LEAF_OF_ORACLE)) {
         htmltext = "30293-01.htm";
       } else {
         htmltext = "30293-04.htm";
       }
     }
   } else if (qs.isStarted()) {
     switch (npc.getId()) {
       case PRIEST_MANUEL:
         {
           if (hasQuestItems(player, CRYSTAL_MEDALLION)) {
             if (!hasAtLeastOneQuestItem(
                 player, SWINDLERS_MONEY, ALLANA_OF_DAIRY, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)) {
               if (qs.isMemoState(2)) {
                 qs.setMemoState(1);
                 qs.setCond(8);
                 htmltext = "30293-09.html";
               } else {
                 qs.setMemoState(1);
                 htmltext = "30293-06.html";
               }
             } else if (hasQuestItems(
                 player, SWINDLERS_MONEY, ALLANA_OF_DAIRY, LIZARD_CAPTAIN_ORDER)) {
               if (!hasQuestItems(player, HALF_OF_DAIRY)) {
                 giveAdena(player, 163800, true);
                 giveItems(player, LEAF_OF_ORACLE, 1);
                 final int level = player.getLevel();
                 if (level >= 20) {
                   addExpAndSp(player, 320534, 20392);
                 } else if (level == 19) {
                   addExpAndSp(player, 456128, 27090);
                 } else {
                   addExpAndSp(player, 591724, 33788);
                 }
                 qs.exitQuest(false, true);
                 player.sendPacket(new SocialAction(player.getObjectId(), 3));
                 qs.saveGlobalQuestVar("1ClassQuestFinished", "1");
                 htmltext = "30293-08.html";
               }
             } else {
               htmltext = "30293-07.html";
             }
           }
           break;
         }
       case ALLANA:
         {
           if (hasQuestItems(player, CRYSTAL_MEDALLION)) {
             if (!hasAtLeastOneQuestItem(
                 player, SWINDLERS_MONEY, ALLANA_OF_DAIRY, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)) {
               if (qs.isMemoState(2)) {
                 htmltext = "30424-05.html";
               } else if (qs.isMemoState(1)) {
                 qs.setCond(2, true);
                 htmltext = "30424-01.html";
               }
             } else if (!hasAtLeastOneQuestItem(
                     player, SWINDLERS_MONEY, ALLANA_OF_DAIRY, HALF_OF_DAIRY)
                 && hasQuestItems(player, LIZARD_CAPTAIN_ORDER)) {
               qs.setMemoState(2);
               giveItems(player, HALF_OF_DAIRY, 1);
               qs.setCond(4, true);
               htmltext = "30424-02.html";
             } else if (!hasAtLeastOneQuestItem(player, SWINDLERS_MONEY, ALLANA_OF_DAIRY)
                 && hasQuestItems(player, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)) {
               if ((qs.isMemoState(3)) && !hasQuestItems(player, TAMIL_NECKLACE)) {
                 qs.setMemoState(2);
                 qs.setCond(4, true);
                 htmltext = "30424-06.html";
               } else {
                 htmltext = "30424-03.html";
               }
             } else if (hasQuestItems(player, SWINDLERS_MONEY, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)
                 && !hasQuestItems(player, ALLANA_OF_DAIRY)) {
               giveItems(player, ALLANA_OF_DAIRY, 1);
               takeItems(player, HALF_OF_DAIRY, 1);
               qs.setCond(9, true);
               htmltext = "30424-04.html";
             } else if (hasQuestItems(
                 player, SWINDLERS_MONEY, LIZARD_CAPTAIN_ORDER, ALLANA_OF_DAIRY)) {
               qs.setCond(7, true);
               htmltext = "30424-05.html";
             }
           }
           break;
         }
       case PERRIN:
         {
           if (hasQuestItems(player, CRYSTAL_MEDALLION, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)) {
             if (hasQuestItems(player, TAMIL_NECKLACE)) {
               giveItems(player, SWINDLERS_MONEY, 1);
               takeItems(player, TAMIL_NECKLACE, 1);
               qs.setCond(6, true);
               htmltext = "30428-04.html";
             } else if (hasQuestItems(player, SWINDLERS_MONEY)) {
               htmltext = "30428-05.html";
             } else if (qs.isMemoState(3)) {
               htmltext = "30428-06.html";
             } else {
               htmltext = "30428-01.html";
             }
           }
           break;
         }
     }
   }
   return htmltext;
 }