@Override
  public String onTalk(L2Npc npc, QuestState st) {
    L2PcInstance player = st.getPlayer();

    L2Clan clan = player.getClan();

    switch (st.getState()) {
      case CREATED:
        return clan == null || !player.isClanLeader() || clan.getLevel() < 6
            ? "31331-0a.htm"
            : "31331-0b.htm";
      case STARTED:
        if (clan == null || !player.isClanLeader()) {
          st.exitQuest(QuestType.REPEATABLE);
          return "31331-6.html";
        }

        int raid = st.getInt("raid");

        if (REWARD_POINTS.containsKey(raid)) {
          if (st.hasQuestItems(REWARD_POINTS.get(raid)[1])) {
            st.playSound(QuestSound.ITEMSOUND_QUEST_FANFARE_1);
            st.takeItems(REWARD_POINTS.get(raid)[1], -1);
            clan.addReputationScore(REWARD_POINTS.get(raid)[2], true);
            player.sendPacket(
                SystemMessage.getSystemMessage(
                        SystemMessageId.CLAN_QUEST_COMPLETED_AND_S1_POINTS_GAINED)
                    .addNumber(REWARD_POINTS.get(raid)[2]));
            clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
            return "31331-" + raid + "b.html";
          } else {
            return "31331-" + raid + "a.html";
          }
        } else {
          return "31331-0.html";
        }
    }
    return null;
  }