@Override public String onFirstTalk(L2Npc npc, L2PcInstance player) { if (player.isClanLeader() || player.hasClanPrivilege(ClanPrivilege.CL_TROOPS_FAME)) { return npc.getId() + ".html"; } return npc.getId() + "-01.html"; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { String htmltext = null; switch (event) { case "32557-01.html": { htmltext = event; break; } case "licence": { final L2Clan clan = player.getClan(); if ((clan == null) || !player.isClanLeader() || (clan.getLevel() < MIN_CLAN_LV)) { htmltext = "32557-02.html"; } else if (hasAtLeastOneQuestItem(player, LICENCE)) { htmltext = "32557-04.html"; } else if (AirShipManager.getInstance().hasAirShipLicense(clan.getId())) { player.sendPacket(SystemMessageId.THE_AIRSHIP_SUMMON_LICENSE_ALREADY_ACQUIRED); } else if (getQuestItemsCount(player, STONE) >= STONE_COUNT) { takeItems(player, STONE, STONE_COUNT); giveItems(player, LICENCE, 1); } else { htmltext = "32557-03.html"; } break; } } return htmltext; }
public static final boolean hasSpecialIngredient(int id, long amount, L2PcInstance player) { switch (id) { case CLAN_REPUTATION: if (player.getClan() == null) { player.sendPacket(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER); break; } if (!player.isClanLeader()) { player.sendPacket(SystemMessageId.ONLY_THE_CLAN_LEADER_IS_ENABLED); break; } if (player.getClan().getReputationScore() < amount) { player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_SCORE_IS_TOO_LOW); break; } return true; case FAME: if (player.getFame() < amount) { player.sendPacket(SystemMessageId.NOT_ENOUGH_FAME_POINTS); break; } return true; } return false; }
@Override public String onTalk(L2Npc npc, L2PcInstance player) { String htmltext = getNoQuestMsg(player); final QuestState st = getQuestState(player, true); if (st == null) { return htmltext; } L2Clan clan = player.getClan(); switch (st.getState()) { case State.CREATED: htmltext = ((clan == null) || !player.isClanLeader() || (clan.getLevel() < 5)) ? "31331-0.htm" : "31331-1.htm"; break; case State.STARTED: if ((clan == null) || !player.isClanLeader()) { st.exitQuest(true); return "31331-8.html"; } if (!st.hasQuestItems(TYRANNOSAURUS_CLAW)) { htmltext = "31331-4.html"; } else { int count = (int) st.getQuestItemsCount(TYRANNOSAURUS_CLAW); int reward = (count < 10) ? (30 * count) : (59 + (30 * count)); st.playSound(QuestSound.ITEMSOUND_QUEST_FANFARE_1); st.takeItems(TYRANNOSAURUS_CLAW, -1); clan.addReputationScore(reward, true); player.sendPacket( SystemMessage.getSystemMessage( SystemMessageId .YOU_HAVE_SUCCESSFULLY_COMPLETED_A_CLAN_QUEST_S1_POINT_S_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION) .addInt(reward)); clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan)); htmltext = "31331-7.html"; } break; default: break; } return htmltext; }
@Override public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) { if (player.getClan() == null) { return null; } QuestState st = null; if (player.isClanLeader()) { st = getQuestState(player, false); } else { L2PcInstance pleader = player.getClan().getLeader().getPlayerInstance(); if ((pleader != null) && player.isInsideRadius(pleader, 1500, true, false)) { st = getQuestState(pleader, false); } } if ((st != null) && st.isStarted()) { st.rewardItems(TYRANNOSAURUS_CLAW, 1); st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET); } return null; }