11package net .swofty .type .goldmine .npcs ;
22
33import net .minestom .server .coordinate .Pos ;
4- import net .swofty .commons .item .ItemType ;
54import net .swofty .type .generic .data .datapoints .DatapointToggles ;
65import net .swofty .type .generic .entity .npc .NPCDialogue ;
76import net .swofty .type .generic .entity .npc .NPCParameters ;
87import net .swofty .type .generic .user .HypixelPlayer ;
98import net .swofty .type .skyblockgeneric .calendar .SkyBlockCalendar ;
9+ import net .swofty .type .skyblockgeneric .mission .MissionData ;
10+ import net .swofty .type .skyblockgeneric .mission .missions .lazyminer .MissionFindLazyMinerPickaxe ;
11+ import net .swofty .type .skyblockgeneric .mission .missions .lazyminer .MissionTalkToLazyMiner ;
1012import net .swofty .type .skyblockgeneric .skill .SkillCategories ;
1113import net .swofty .type .skyblockgeneric .user .SkyBlockPlayer ;
1214
@@ -47,30 +49,48 @@ public boolean looking() {
4749 public void onClick (PlayerClickNPCEvent event ) {
4850 SkyBlockPlayer player = (SkyBlockPlayer ) event .player ();
4951 if (isInDialogue (player )) return ;
50- boolean hasSpokenBefore = player .getToggles (). get ( DatapointToggles . Toggles . ToggleType . HAS_SPOKEN_TO_LAZY_MINER );
52+ MissionData data = player .getMissionData ( );
5153
52- if (!hasSpokenBefore ) {
53- setDialogue (player , "intro" ).thenRun (() -> {
54- player .getToggles ().set (DatapointToggles .Toggles .ToggleType .HAS_SPOKEN_TO_LAZY_MINER , true );
54+ // Check if mission is completed - show idle dialogue
55+ if (data .hasCompleted (MissionTalkToLazyMiner .class )) {
56+ if (player .getSkills ().getCurrentLevel (SkillCategories .MINING ) < 5 ) {
57+ setDialogue (player , "not-reached-deep-caverns" );
58+ return ;
59+ }
60+ setDialogue (player , "idle" );
61+ return ;
62+ }
63+
64+ // Check if player needs to return the pickaxe (MissionTalkToLazyMiner is active)
65+ if (data .isCurrentlyActive (MissionTalkToLazyMiner .class )) {
66+ setDialogue (player , "quest-complete" ).thenRun (() -> {
67+ data .endMission (MissionTalkToLazyMiner .class );
5568 });
5669 return ;
5770 }
5871
59- boolean hasFoundPickaxe = player . getToggles (). get ( DatapointToggles . Toggles . ToggleType . HAS_FOUND_LAZY_MINER_PICKAXE );
60- if (! hasFoundPickaxe ) {
72+ // Check if player is looking for the pickaxe (MissionFindLazyMinerPickaxe is active)
73+ if (data . isCurrentlyActive ( MissionFindLazyMinerPickaxe . class ) ) {
6174 setDialogue (player , "no-pickaxe-found" );
6275 return ;
63- } else if (!player .getCollection ().unlocked (ItemType .GOLD_INGOT ) || !player .getCollection ().unlocked (ItemType .IRON_INGOT )) {
64- setDialogue (player , "found-pick-no-collection" );
65- return ;
6676 }
6777
68- if (player .getSkills ().getCurrentLevel (SkillCategories .MINING ) < 5 ) {
69- setDialogue (player , "not-reached-deep-caverns" );
78+ // First interaction - check special case where player already found pickaxe
79+ boolean hasFoundPickaxe = player .getToggles ().get (DatapointToggles .Toggles .ToggleType .HAS_FOUND_LAZY_MINER_PICKAXE );
80+ if (hasFoundPickaxe ) {
81+ // Player found the pickaxe before talking to Lazy Miner - skip to talk mission
82+ setDialogue (player , "found-pick-intro" ).thenRun (() -> {
83+ player .getToggles ().set (DatapointToggles .Toggles .ToggleType .HAS_SPOKEN_TO_LAZY_MINER , true );
84+ data .startMission (MissionTalkToLazyMiner .class );
85+ });
7086 return ;
7187 }
7288
73- setDialogue (player , "idle" );
89+ // Normal first interaction - start the quest
90+ setDialogue (player , "first-interaction" ).thenRun (() -> {
91+ player .getToggles ().set (DatapointToggles .Toggles .ToggleType .HAS_SPOKEN_TO_LAZY_MINER , true );
92+ data .startMission (MissionFindLazyMinerPickaxe .class );
93+ });
7494 }
7595
7696 @ Override
@@ -86,12 +106,16 @@ public DialogueSet[] getDialogueSets(HypixelPlayer player) {
86106 "Find my pickaxe in the Gold Mines! I'm not going back down there..."
87107 }).build (),
88108 DialogueSet .builder ()
89- .key ("found-pick-no-collection" ).lines (new String []{
90- "Collect iron and gold ingots with that pickaxe you found!" ,
91- "..Or do it the long way and smelt the ore yourself." ,
92- "Smelting Touch is a really useful enchantment. It automatically smelts ores into ingots!"
93- })
94- .build (),
109+ .key ("found-pick-intro" ).lines (new String []{
110+ "Oh! You already found my pickaxe! That's amazing!" ,
111+ "Keep it, it has a special enchantment. Come talk to me when you're ready!"
112+ }).build (),
113+ DialogueSet .builder ()
114+ .key ("quest-complete" ).lines (new String []{
115+ "You found it! Thank you so much!" ,
116+ "Keep it as a reward. That pickaxe has Smelting Touch - it automatically smelts ores into ingots!" ,
117+ "It'll be very useful for collecting iron and gold."
118+ }).build (),
95119 DialogueSet .builder ()
96120 .key ("not-reached-deep-caverns" ).lines (new String []{
97121 "The Deep Caverns are full of strange creatures and expensive treasures." ,
0 commit comments