Automatically send NpcLogList with Quest onKill.

This commit is contained in:
MobiusDev
2018-05-30 21:05:25 +00:00
parent 592ce09803
commit aafd0051e8
265 changed files with 109 additions and 471 deletions

View File

@@ -171,7 +171,6 @@ public final class Q00453_NotStrongEnoughAlone extends Quest
checkProgress(st, 20, MONSTER3[0], MONSTER3[1], MONSTER3[2]);
}
}
sendNpcLogList(player);
}
@Override
@@ -380,7 +379,6 @@ public final class Q00453_NotStrongEnoughAlone extends Quest
{
final QuestState qs = getQuestState(activeChar, false);
final Set<NpcLogListHolder> npcLogList = new HashSet<>(3);
if (qs != null)
{
switch (qs.getCond())

View File

@@ -176,7 +176,6 @@ public class Q00462_StuffedAncientHeroes extends Quest
else
{
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
}
return super.onKill(npc, killer, isSummon);

View File

@@ -215,7 +215,6 @@ public final class Q00476_PlainMission extends Quest
{
st.setCond(2, true);
}
sendNpcLogList(killer);
}
return super.onKill(npc, killer, isSummon);
}

View File

@@ -175,11 +175,6 @@ public final class Q00490_DutyOfTheSurvivor extends Quest
{
st.setCond(2);
}
else
{
sendNpcLogList(player);
}
}
}
return super.onKill(npc, player, isSummon);
@@ -189,7 +184,7 @@ public final class Q00490_DutyOfTheSurvivor extends Quest
public Set<NpcLogListHolder> getNpcLogList(L2PcInstance player)
{
final QuestState qs = getQuestState(player, false);
if (qs != null)
if ((qs != null) && qs.isCond(1))
{
final Set<NpcLogListHolder> npcLogList = new HashSet<>(2);
npcLogList.add(new NpcLogListHolder(EXTRACT, false, (int) getQuestItemsCount(player, EXTRACT)));

View File

@@ -158,10 +158,6 @@ public final class Q00493_KickingOutUnwelcomeGuests extends Quest
{
st.setCond(2, true);
}
else
{
sendNpcLogList(player);
}
}
}
@@ -176,7 +172,7 @@ public final class Q00493_KickingOutUnwelcomeGuests extends Quest
public Set<NpcLogListHolder> getNpcLogList(L2PcInstance player)
{
final QuestState st = getQuestState(player, false);
if (st != null)
if ((st != null) && st.isCond(1))
{
final Set<NpcLogListHolder> npcLogList = new HashSet<>(5);
npcLogList.add(new NpcLogListHolder(LUNATIC_CREATURE, false, st.getInt(Integer.toString(LUNATIC_CREATURE))));

View File

@@ -172,7 +172,6 @@ public class Q00937_ToReviveTheFishingGuild extends Quest
}
else
{
sendNpcLogList(player);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -85,7 +85,6 @@ public final class Q10305_UnstoppableFutileEfforts extends Quest
if (killedCocoon < 5)
{
qs.setMemoStateEx(LARGE_COCOON, killedCocoon);
sendNpcLogList(player);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
else
@@ -152,7 +151,6 @@ public final class Q10305_UnstoppableFutileEfforts extends Quest
public Set<NpcLogListHolder> getNpcLogList(L2PcInstance activeChar)
{
final QuestState qs = getQuestState(activeChar, false);
if ((qs != null) && qs.isCond(1))
{
final Set<NpcLogListHolder> npcLogList = new HashSet<>(1);

View File

@@ -242,7 +242,6 @@ public final class Q10333_DisappearedSakum extends Quest
{
qs.setCond(3, true);
}
sendNpcLogList(killer);
}
return super.onKill(npc, killer, isSummon);
}

View File

@@ -260,7 +260,6 @@ public final class Q10335_RequestToFindSakum extends Quest
{
st.setCond(3, true);
}
sendNpcLogList(killer);
}
return super.onKill(npc, killer, isSummon);
}

View File

@@ -271,7 +271,6 @@ public final class Q10337_SakumsImpact extends Quest
{
qs.setCond(3, true);
}
sendNpcLogList(killer);
}
return super.onKill(npc, killer, isSummon);
}

View File

@@ -181,7 +181,6 @@ public final class Q10339_FightingTheForgotten extends Quest
else
{
st.setMemoState(monsterCount);
sendNpcLogList(player);
}
}
return super.onKill(npc, player, isSummon);

View File

@@ -210,7 +210,6 @@ public final class Q10353_CertificationOfValue extends Quest
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final QuestState qs = getQuestState(killer, false);
if ((qs != null) && qs.isStarted() && qs.isCond(2))
{
final int killCount = qs.getInt(KILL_COUNT_VAR) + 1;
@@ -222,7 +221,6 @@ public final class Q10353_CertificationOfValue extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -187,7 +187,6 @@ public final class Q10358_DividedSakumPoslof extends Quest
{
st.setCond(2, true);
}
sendNpcLogList(killer);
}
else if (st.isCond(3))
{

View File

@@ -122,7 +122,6 @@ public final class Q10362_CertificationOfTheSeeker extends Quest
if (killedStalker <= 10)
{
qs.setMemoStateEx(STALKER, killedStalker);
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
@@ -132,7 +131,6 @@ public final class Q10362_CertificationOfTheSeeker extends Quest
if (killedCrawler <= 10)
{
qs.setMemoStateEx(CRAWLER, killedCrawler);
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
@@ -210,7 +208,6 @@ public final class Q10362_CertificationOfTheSeeker extends Quest
public Set<NpcLogListHolder> getNpcLogList(L2PcInstance activeChar)
{
final QuestState qs = getQuestState(activeChar, false);
if ((qs != null) && qs.isCond(2))
{
final Set<NpcLogListHolder> npcLogList = new HashSet<>(2);

View File

@@ -149,7 +149,6 @@ public final class Q10366_ReportOnTheSituationAtTheRuins extends Quest
else
{
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
}
return super.onKill(npc, killer, isSummon);

View File

@@ -145,7 +145,6 @@ public class Q10389_TheVoiceOfAuthority extends Quest
else
{
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
}
return super.onKill(npc, killer, isSummon);

View File

@@ -181,7 +181,6 @@ public final class Q10394_MutualBenefit extends Quest
{
st.setCond(2, true);
}
sendNpcLogList(killer);
}
return super.onKill(npc, killer, isSummon);
}

View File

@@ -162,10 +162,6 @@ public final class Q10395_NotATraitor extends Quest
{
st.setCond(2, true);
}
else
{
sendNpcLogList(killer);
}
}
return super.onKill(npc, killer, isSummon);
}

View File

@@ -148,7 +148,6 @@ public final class Q10402_NowhereToTurn extends Quest
killCount++;
st.set("KILLED_COUNT", killCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
if (killCount == 40)

View File

@@ -140,7 +140,6 @@ public final class Q10406_BeforeDarknessBearsFruit extends Quest
killCount++;
st.set("KILLED_COUNT", killCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
if (killCount == 10)

View File

@@ -213,7 +213,6 @@ public class Q10407_LetsGoFishing extends Quest
}
else
{
sendNpcLogList(player);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -161,7 +161,6 @@ public final class Q10410_EmbryoInTheSwampOfScreams extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
@@ -179,7 +178,6 @@ public final class Q10410_EmbryoInTheSwampOfScreams extends Quest
public Set<NpcLogListHolder> getNpcLogList(L2PcInstance activeChar)
{
final QuestState st = getQuestState(activeChar, false);
if ((st != null) && st.isCond(1))
{
final Set<NpcLogListHolder> npcLogList = new HashSet<>(1);

View File

@@ -190,7 +190,6 @@ public final class Q10413_EmbryoInTheForestOfTheDead extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
@@ -208,7 +207,6 @@ public final class Q10413_EmbryoInTheForestOfTheDead extends Quest
public Set<NpcLogListHolder> getNpcLogList(L2PcInstance activeChar)
{
final QuestState st = getQuestState(activeChar, false);
if ((st != null) && st.isCond(1))
{
final Set<NpcLogListHolder> npcLogList = new HashSet<>(1);

View File

@@ -20,8 +20,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import quests.Q10416_InSearchOfTheEyeOfArgos.Q10416_InSearchOfTheEyeOfArgos;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.enums.Race;
@@ -34,6 +32,8 @@ import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
import com.l2jmobius.gameserver.network.NpcStringId;
import quests.Q10416_InSearchOfTheEyeOfArgos.Q10416_InSearchOfTheEyeOfArgos;
/**
* Daimon the White-eyed (10417)
* @author St3eT, Iris
@@ -226,7 +226,6 @@ public final class Q10417_DaimonTheWhiteEyed extends Quest
qs.set("KillCount_MOBS", mobCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
sendNpcLogList(killer);
}
if (mobCount == 100)
@@ -242,7 +241,6 @@ public final class Q10417_DaimonTheWhiteEyed extends Quest
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
qs.setCond(3, true);
}
sendNpcLogList(killer);
}
}

View File

@@ -143,7 +143,6 @@ public final class Q10446_HitAndRun extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -207,7 +207,6 @@ public class Q10522_TheDarkSecretOfVarkaSilenos extends Quest
{
qs.setCond(2, true);
}
sendNpcLogList(killer);
}
return super.onKill(npc, killer, isSummon);
}

View File

@@ -217,7 +217,6 @@ public class Q10526_TheDarkSecretOfTheKetraOrcs extends Quest
{
qs.setCond(2, true);
}
sendNpcLogList(killer);
}
return super.onKill(npc, killer, isSummon);
}
@@ -226,7 +225,7 @@ public class Q10526_TheDarkSecretOfTheKetraOrcs extends Quest
public Set<NpcLogListHolder> getNpcLogList(L2PcInstance player)
{
final QuestState qs = getQuestState(player, false);
if (qs.isCond(1))
if ((qs != null) && qs.isCond(1))
{
final Set<NpcLogListHolder> holder = new HashSet<>(2);
holder.add(new NpcLogListHolder(KETRA_BACKUP_SHOOTER, false, qs.getInt("killed_" + KETRA_BACKUP_SHOOTER)));

View File

@@ -209,36 +209,38 @@ public final class Q10541_TrainLikeTheRealThing extends Quest
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final QuestState qs = getQuestState(killer, false);
if ((qs != null) && qs.isCond(1))
if (qs != null)
{
int killCount = qs.getInt(KILL_COUNT_VAR);
qs.set(KILL_COUNT_VAR, ++killCount);
if (killCount >= 4)
if (qs.isCond(1))
{
qs.setCond(2, true);
int killCount = qs.getInt(KILL_COUNT_VAR);
qs.set(KILL_COUNT_VAR, ++killCount);
if (killCount >= 4)
{
qs.setCond(2, true);
}
else
{
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
else
else if (qs.isCond(4))
{
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
}
else if ((qs != null) && qs.isCond(4))
{
int kills = qs.getInt(Integer.toString(SCARECROW));
if (kills < 4)
{
kills++;
qs.set(Integer.toString(SCARECROW), kills);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
final ExQuestNpcLogList log = new ExQuestNpcLogList(getId());
log.addNpc(SCARECROW, qs.getInt(Integer.toString(SCARECROW)));
qs.getPlayer().sendPacket(log);
if (qs.getInt(Integer.toString(SCARECROW)) >= 4)
{
qs.setCond(5, true);
int kills = qs.getInt(Integer.toString(SCARECROW));
if (kills < 4)
{
kills++;
qs.set(Integer.toString(SCARECROW), kills);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
final ExQuestNpcLogList log = new ExQuestNpcLogList(getId());
log.addNpc(SCARECROW, qs.getInt(Integer.toString(SCARECROW)));
qs.getPlayer().sendPacket(log);
if (qs.getInt(Integer.toString(SCARECROW)) >= 4)
{
qs.setCond(5, true);
}
}
}
return super.onKill(npc, killer, isSummon);

View File

@@ -171,7 +171,6 @@ public final class Q10743_StrangeFungus extends Quest
qs.set(EVOLVED_SPAWN_VAR, killCount);
}
qs.set(KILL_COUNT_VAR, qs.getInt(KILL_COUNT_VAR) + 1);
sendNpcLogList(killer);
break;
}
case EVOLVED_GROWLER:

View File

@@ -432,7 +432,6 @@ public final class Q10751_WindsOfFateEncounters extends Quest
{
qs.set(KILL_COUNT_VAR, ++killCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
if ((killCount >= 5) && !L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 1000).stream().anyMatch(n -> ((n.getId() == TELESHA) && (n.getSummoner() == killer))))

View File

@@ -634,7 +634,6 @@ public final class Q10753_WindsOfFateChoices extends Quest
giveItems(killer, CRYSTAL_EYE, 1);
qs.set(CRYSTAL_EYE_VAR, ++EyeCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
break;
}
@@ -645,7 +644,6 @@ public final class Q10753_WindsOfFateChoices extends Quest
giveItems(killer, BROKEN_STONE_OF_PURITY, 1);
qs.set(BROKEN_STONE_OF_PURITY_VAR, ++PurityCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
break;
}
@@ -656,7 +654,6 @@ public final class Q10753_WindsOfFateChoices extends Quest
giveItems(killer, MIRACLE_DRUG_OF_ENCHANTMENT, 1);
qs.set(EMPTY_REGEANT_FLASK_VAR, ++FlaskCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
break;
}

View File

@@ -141,13 +141,11 @@ public final class Q10757_QuietingTheStorm extends Quest
if (vortexCount < 5)
{
qs.set(VORTEX_COUNT_VAR, ++vortexCount);
sendNpcLogList(killer);
}
}
else if (windimaCount != 1)
{
qs.set(WINDIMA_COUNT_VAR, ++windimaCount);
sendNpcLogList(killer);
}
if ((vortexCount >= 5) && (windimaCount >= 1))

View File

@@ -146,10 +146,6 @@ public class Q10761_AnOrcInLove extends Quest
{
qs.setCond(2, true);
}
else
{
sendNpcLogList(killer);
}
}
}
return super.onKill(npc, killer, isSummon);

View File

@@ -157,10 +157,6 @@ public final class Q10780_AWeakenedBarrier extends Quest
{
qs.setCond(2, true);
}
else
{
sendNpcLogList(killer);
}
}
}
return super.onKill(npc, killer, isSummon);

View File

@@ -159,7 +159,6 @@ public final class Q10786_ResidentProblemSolver extends Quest
else
{
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(killer);
}
}
return super.onKill(npc, killer, isSummon);

View File

@@ -152,7 +152,6 @@ public class Q10790_AMercenaryHelper extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -156,7 +156,6 @@ public final class Q10793_SaveTheSouls extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -203,7 +203,6 @@ public final class Q10794_InvestigateTheForest extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -166,7 +166,6 @@ public class Q10796_TheEyeThatDefiedTheGods extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -152,7 +152,6 @@ public class Q10799_StrangeThingsAfootInTheValley extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -154,7 +154,6 @@ public class Q10800_ReconnaissanceAtDragonValley extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -186,7 +186,6 @@ public final class Q10815_StepUp extends Quest
else
{
qs.set("chat", chatCount);
sendNpcLogList(player);
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
{
REUSE.put(player.getObjectId(), now.plus(Config.WORLD_CHAT_INTERVAL));
@@ -200,13 +199,10 @@ public final class Q10815_StepUp extends Quest
public Set<NpcLogListHolder> getNpcLogList(L2PcInstance activeChar)
{
final QuestState qs = getQuestState(activeChar, false);
if (qs != null)
if ((qs != null) && qs.isCond(1))
{
final Set<NpcLogListHolder> npcLogList = new HashSet<>(1);
if (qs.isCond(1))
{
npcLogList.add(new NpcLogListHolder(NpcStringId.WORLD_CHAT, qs.getInt("chat")));
}
npcLogList.add(new NpcLogListHolder(NpcStringId.WORLD_CHAT, qs.getInt("chat")));
return npcLogList;
}
return super.getNpcLogList(activeChar);

View File

@@ -156,7 +156,6 @@ public final class Q10838_TheReasonForNotBeingAbleToGetOut extends Quest
{
giveItems(killer, DARK_ATELIA_NATURALIZER, 1);
}
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -150,7 +150,6 @@ public final class Q10839_BlackbirdsNameValue extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -151,7 +151,6 @@ public final class Q10840_TimeToRecover extends Quest
}
else
{
sendNpcLogList(killer);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}

View File

@@ -1122,6 +1122,10 @@ public class Quest extends AbstractScript implements IIdentifiable
*/
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
if (!getNpcLogList(killer).isEmpty())
{
sendNpcLogList(killer);
}
return null;
}
@@ -2937,9 +2941,7 @@ public class Quest extends AbstractScript implements IIdentifiable
public void sendNpcLogList(L2PcInstance activeChar)
{
final QuestState qs = activeChar.getQuestState(getName());
if (qs != null)
if (activeChar.getQuestState(getName()) != null)
{
final ExQuestNpcLogList packet = new ExQuestNpcLogList(getId());
getNpcLogList(activeChar).forEach(packet::add);