diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/quests/Q10984_CollectSpiderweb/Q10984_CollectSpiderweb.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/quests/Q10984_CollectSpiderweb/Q10984_CollectSpiderweb.java index ccf736d3ed..75896c6480 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/quests/Q10984_CollectSpiderweb/Q10984_CollectSpiderweb.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/quests/Q10984_CollectSpiderweb/Q10984_CollectSpiderweb.java @@ -16,13 +16,9 @@ */ package quests.Q10984_CollectSpiderweb; -import java.util.HashSet; -import java.util.Set; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.impl.CategoryData; import org.l2jmobius.gameserver.enums.CategoryType; -import org.l2jmobius.gameserver.enums.QuestSound; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventType; @@ -31,7 +27,6 @@ import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; import org.l2jmobius.gameserver.model.events.annotations.RegisterType; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; import org.l2jmobius.gameserver.model.holders.ItemHolder; -import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.network.NpcStringId; @@ -40,7 +35,7 @@ import org.l2jmobius.gameserver.network.serverpackets.classchange.ExRequestClass /** * Collect Spiderweb (10984) - * @author RobikBobik + * @author RobikBobik, Mobius * @Notee: Based on NA server September 2019 */ public class Q10984_CollectSpiderweb extends Quest @@ -53,6 +48,7 @@ public class Q10984_CollectSpiderweb extends Quest private static final int CRIMSON_SPIDER = 20460; private static final int PINCER_SPIDER = 20466; // Items + private static final int GIANT_COBWEB = 91652; private static final ItemHolder SOE_TO_CAPTAIN_BATHIS = new ItemHolder(91651, 1); private static final ItemHolder SOE_NOVICE = new ItemHolder(10650, 20); private static final ItemHolder SPIRIT_ORE = new ItemHolder(3031, 50); @@ -74,7 +70,6 @@ public class Q10984_CollectSpiderweb extends Quest private static final ItemHolder MOON_SANDALS = new ItemHolder(7859, 1); // Misc private static final int MAX_LEVEL = 20; - private static final String KILL_COUNT_VAR = "KillCount"; public Q10984_CollectSpiderweb() { @@ -82,6 +77,7 @@ public class Q10984_CollectSpiderweb extends Quest addStartNpc(HERBIEL); addTalkId(HERBIEL, CAPTAIN_BATHIS); addKillId(HOOK_SPIDER, CRIMSON_SPIDER, PINCER_SPIDER); + registerQuestItems(GIANT_COBWEB); addCondMaxLevel(MAX_LEVEL, "no_lvl.html"); setQuestNameNpcStringId(NpcStringId.LV_15_20_SPIDER_WEB); } @@ -214,44 +210,6 @@ public class Q10984_CollectSpiderweb extends Quest return htmltext; } - @Override - public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) - { - final QuestState qs = getQuestState(killer, false); - if ((qs != null) && qs.isCond(1)) - { - final int killCount = qs.getInt(KILL_COUNT_VAR) + 1; - if (killCount < 30) - { - qs.set(KILL_COUNT_VAR, killCount); - playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); - sendNpcLogList(killer); - } - else - { - qs.setCond(2, true); - qs.unset(KILL_COUNT_VAR); - killer.sendPacket(new ExShowScreenMessage("You hunted all monsters.#Use the Scroll of Escape in you inventory to go to Captain Bathis in the Town of Gludio.", 5000)); - giveItems(killer, SOE_TO_CAPTAIN_BATHIS); - } - } - return super.onKill(npc, killer, isSummon); - } - - @Override - public Set getNpcLogList(PlayerInstance player) - { - final QuestState qs = getQuestState(player, false); - if ((qs != null) && qs.isCond(1)) - { - final Set holder = new HashSet<>(); - // TODO: Find correct ID of string - holder.add(new NpcLogListHolder(NpcStringId.LV_15_20_SPIDER_WEB_IN_PROGRESS.getId(), true, qs.getInt(KILL_COUNT_VAR))); - return holder; - } - return super.getNpcLogList(player); - } - @Override public String onTalk(Npc npc, PlayerInstance player) { @@ -293,6 +251,26 @@ public class Q10984_CollectSpiderweb extends Quest return htmltext; } + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final QuestState qs = getQuestState(killer, false); + if ((qs != null) && qs.isCond(1)) + { + if (getQuestItemsCount(killer, GIANT_COBWEB) < 30) + { + giveItems(killer, GIANT_COBWEB, 1, true); + } + if (getQuestItemsCount(killer, GIANT_COBWEB) >= 30) + { + qs.setCond(2, true); + killer.sendPacket(new ExShowScreenMessage("You hunted all monsters.#Use the Scroll of Escape in you inventory to go to Captain Bathis in the Town of Gludio.", 5000)); + giveItems(killer, SOE_TO_CAPTAIN_BATHIS); + } + } + return super.onKill(npc, killer, isSummon); + } + @RegisterEvent(EventType.ON_PLAYER_LOGIN) @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) public void OnPlayerLogin(OnPlayerLogin event) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91600-91699.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91600-91699.xml index 9c1cce47df..93b6ec48cd 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91600-91699.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91600-91699.xml @@ -571,6 +571,7 @@ +