Skip to content

Commit 347e13c

Browse files
Merge pull request #605 from ArikSquad/feat/quests
First 2 Foraging Quests
2 parents 5f14d1f + 6714df7 commit 347e13c

29 files changed

Lines changed: 1064 additions & 30 deletions

File tree

commons/src/main/java/net/swofty/commons/skyblock/item/ItemType.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,8 @@ public enum ItemType {
582582
MINER_ARMOR_LEGGINGS(Material.IRON_LEGGINGS, Rarity.RARE),
583583
MINER_ARMOR_BOOTS(Material.IRON_BOOTS, Rarity.RARE),
584584

585+
CHARLIE_TROUSERS(Material.LEATHER_LEGGINGS, Rarity.COMMON),
586+
585587
/**
586588
* Pickaxes
587589
*/
@@ -743,6 +745,8 @@ public enum ItemType {
743745
HUB_DARK_AUCTION_TRAVEL_SCROLL(Material.MAP, Rarity.EPIC),
744746
HUB_CRYPTS_TRAVEL_SCROLL(Material.MAP, Rarity.EPIC),
745747

748+
FORAGING_1_TRAVEL_SCROLL(Material.MAP, Rarity.RARE),
749+
746750
/**
747751
* Crimson Isles
748752
*/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
items:
2+
- id: CHARLIE_TROUSERS
3+
rarity: COMMON
4+
default_statistics:
5+
defense: 15
6+
health: 45
7+
foraging_fortune: 6
8+
components:
9+
- id: CUSTOM_DISPLAY_NAME
10+
display_name: Charlie's Trousers
11+
- id: STANDARD_ITEM
12+
standard_item_type: HELMET
13+
- id: LEATHER_COLOR
14+
r: '20'
15+
g: '121'
16+
b: '100'
17+
- id: TRACKED_UNIQUE
18+
- id: MUSEUM
19+
museum_category: ARMOR_SETS

configuration/skyblock/items/travelscroll.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ items:
3535
components:
3636
- id: TRAVEL_SCROLL
3737
scroll_type: HUB_DARK_AUCTION
38+
- id: FORAGING_1_TRAVEL_SCROLL
39+
material: PAPER
40+
rarity: RARE
41+
components:
42+
- id: TRAVEL_SCROLL
43+
scroll_type: THE_PARK
3844
- id: HUB_CRYPTS_TRAVEL_SCROLL
3945
material: PAPER
4046
rarity: UNCOMMON

type.generic/src/main/java/net/swofty/type/generic/gui/inventory/ItemStackCreator.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,23 @@ public static ItemStack.Builder updateLore(ItemStack.Builder builder, List<Strin
129129
.set(DataComponents.TOOLTIP_DISPLAY, DEFAULT_TOOLTIP_DISPLAY));
130130
}
131131

132+
/**
133+
* Appends lore lines to the existing lore of the given {@link ItemStack.Builder}.
134+
*
135+
* @param builder the {@link ItemStack.Builder} to modify
136+
* @param lore the lore lines to append
137+
* @return the modified {@link ItemStack.Builder}
138+
*/
139+
public static ItemStack.Builder appendLore(ItemStack.Builder builder, List<String> lore) {
140+
List<Component> existingLore = builder.build().get(DataComponents.LORE);
141+
for (String s : lore) {
142+
existingLore.add(Component.text(color(s)).decoration(TextDecoration.ITALIC, false));
143+
}
144+
145+
return clearAttributes(builder.set(DataComponents.LORE, existingLore)
146+
.set(DataComponents.TOOLTIP_DISPLAY, DEFAULT_TOOLTIP_DISPLAY));
147+
}
148+
132149
/**
133150
* Marks the given {@link ItemStack.Builder} as not editable.
134151
*

type.hub/src/main/java/net/swofty/type/hub/TypeHubLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public LoaderValues getLoaderValues() {
139139
case SKYBLOCK_SPIDERS_DEN -> new Pos(-159.5, 73, -158.5, -45, 0);
140140
case SKYBLOCK_GOLD_MINE -> new Pos(-9.5, 64, -228.5, 0, 0);
141141
case SKYBLOCK_DUNGEON_HUB -> new Pos(-44, 88, 11.5, 0, 0);
142-
default -> new Pos(-2.5, 72.5, -69.5, 180, 0);
142+
default -> new Pos(-2.5, 70, -69.5, 180, 0);
143143
}, // Spawn position
144144
true // Announce death messages
145145
);

type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberJack.java

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
package net.swofty.type.hub.npcs;
22

3+
import net.kyori.adventure.text.format.NamedTextColor;
34
import net.minestom.server.coordinate.Pos;
5+
import net.swofty.commons.skyblock.item.ItemType;
46
import net.swofty.type.generic.entity.npc.HypixelNPC;
7+
import net.swofty.type.generic.entity.npc.NPCOption;
58
import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration;
69
import net.swofty.type.generic.user.HypixelPlayer;
10+
import net.swofty.type.skyblockgeneric.gui.inventories.GUIClaimReward;
711
import net.swofty.type.skyblockgeneric.mission.MissionData;
812
import net.swofty.type.skyblockgeneric.mission.missions.lumber.MissionBreakOaklog;
913
import net.swofty.type.skyblockgeneric.mission.missions.lumber.MissionTalkToLumberjack;
@@ -20,17 +24,17 @@ public NPCLumberJack() {
2024
super(new HumanConfiguration() {
2125
@Override
2226
public String[] holograms(HypixelPlayer player) {
23-
return new String[]{"Lumber Jack", "§e§lCLICK"};
27+
return new String[]{"§aLumber Jack", "§e§lCLICK"};
2428
}
2529

2630
@Override
2731
public String signature(HypixelPlayer player) {
28-
return "kyxxya3FqBJo6onG3bC1BjsjrF4uWTDd7Qitz14iNFwvZOn6FsW1A7dkNiZmiR1nVBfex7b4XHYAb6f3jXx8wIEvoDzSjzVLkCkzbQ9aMTTlDSAvkZ/fqtgMJbbXnppUSETmbWm7fdPjr4P5J30+Mz5vb66kNYu8QXsWqQ36YxI6sS2P77+vLdq+n1l389Npw1uMBpMLPjXaTsjAMrq1U6bDbTj7YwYqtURh0hxJm6v3q9d+oXD989fvYu04DYtEiW6H3VDjtvoEAb+m3H9tlDt74SNVXlIJ0lGa6RNpidBhKgSS38F0P5nMo1XbHJ/FcrWP+UZ6D4rT5TuW0T1J7n+5q+/LMMOR2hofFHgdqmTD85tTOmTmKKtIBPW9yreEKNZg7Ah/s3jStnVosp6A9qkpTcmdneRJwL+ZvHcpCbZpJq9Ii/NV+cBNrL49ylVCDZnRN4I7xENYfAq/Xe241cs2bEErrpu9uDH7dXSnhwQn4PdtMN6ZZrr4IJS2sjAyPjcuN/A006gs3Cu+9Cb4MViRCdIgOZDsIV/C0yDqr3+/SgKa+GRp7qIiphIMgRXC03GDSd/btYea1g8qJhhnkAL5MStubm/rdPaEf8wBc3y8Kc4pdEemo5kHQ8SPGvrk+xI8sGWKmlf/bZkyXKw9Wdhg/npeptxjNb2rUuaIDvk=";
32+
return "cxEDP/ZmKhHdhmmHUgbqSxSgoD8w/wQk3IysGKDggfZUR3tsd1BFqpwsE37pv1LUsUkHr+mF0R6aAC0ZWQzT5kMT1546s5JAyRPFNa4P9iScE+aWlPCK1iqw2tMDqD73hYRtlSKuDRlxjbKXbHBltAsZYF1KEHh7uy+WJn+kUTuZI9Z96AUDkZlx/zxNO7Biq4pxZyilU6f2UId58fAkJYbMOYzxwCCOP+4NsH4vZazZ5YRwjpBnxrgI6epBe4KczoEqQZOo5lCEYrDMeBBjtcO9ktRnR+ddhTkPwZFHMqJaONOaeUWPar4/G977gwDwOkC0y5yw1hCABU66OiY1OsmshE9s5r8MOHYVFdwacp8M1f6xMmydmkl/VB8tCDsUMQIFlXHfF1YyNJ6UZTOhxyqI2ntDfVxcN5EMEC4c0lsycp8k5wg41aTlksvzwSQ1H+QkRByo1xG7WIZNr90mkJzwUG7Ggr3q+DZZeo8gQKMRTYIa5EBtiSTugMPcv4pw3xqv23E2kB5PvmumHGg4jh0VwE7CgFPD3f3SIZsT6bCKxrQ1pq1XQlAKsJbu341l2j01UkPG1GThjTGBTwnwV+vZUA+hG/2c/wyfbfqquJBH5PqaM7ZvzvyGEVMmh8wU663dBNkXQHoW3/Y/yg1eLPxwm9aSDffWMJVaGfXFuq4=";
2933
}
3034

3135
@Override
3236
public String texture(HypixelPlayer player) {
33-
return "ewogICJ0aW1lc3RhbXAiIDogMTU5MTQ2MzM5MzU5MywKICAicHJvZmlsZUlkIiA6ICJmMjljOTIyMmVjNmY0NjExOTc3YWNkMmFjYzExNDAxOCIsCiAgInByb2ZpbGVOYW1lIiA6ICJJSVJleWRlbklJIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2NkMGFiZGQ5ZjZlZTdkODM3MGQyNjIxMDljYjg1M2JhY2QzZjQzZjhjZTQyNDExNjRkMDhlM2QyYTU2ODNlMzIiCiAgICB9CiAgfQp9";
37+
return "eyJ0aW1lc3RhbXAiOjE1NTA2Nzg1MjAzNzMsInByb2ZpbGVJZCI6ImEyZjgzNDU5NWM4OTRhMjdhZGQzMDQ5NzE2Y2E5MTBjIiwicHJvZmlsZU5hbWUiOiJiUHVuY2giLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzY4MjUwMzBlNzc1MmZhZjdmODE2YWMyYTIwYjExNDMyYWY0YjJjZGU0OTMyZGMwZTkyMDgzMWU2MjE4MDhlZTgifX19";
3438
}
3539

3640
@Override
@@ -53,40 +57,73 @@ public void onClick(NPCInteractEvent e) {
5357

5458
if (data.isCurrentlyActive(MissionTalkToLumberjack.class)) {
5559
setDialogue(player, "initial-hello").thenRun(() -> {
56-
data.endMission(MissionTalkToLumberjack.class);
60+
NPCOption.sendOption(player, "lumber_jack", List.of(
61+
new NPCOption.Option(
62+
"r_2_1",
63+
NamedTextColor.GREEN,
64+
false,
65+
"Sure",
66+
(p) -> {
67+
setDialogue(p, "option-accept").thenRun(() -> {
68+
data.endMission(MissionTalkToLumberjack.class);
69+
});
70+
}
71+
),
72+
new NPCOption.Option(
73+
"r_2_2",
74+
NamedTextColor.RED,
75+
false,
76+
"Nah, I'm good",
77+
(p) -> {
78+
setDialogue(player, "option-nah");
79+
}
80+
)
81+
));
5782
});
5883
return;
5984
}
6085
if (!data.hasCompleted(MissionBreakOaklog.class)) {
61-
player.sendMessage("Bring me some Logs. You can chop them down in this Forest!");
86+
sendNPCMessage(player, "Please collect and then bring to me §a20 Oak Logs§f! You can get 'em from the §bForest §fjust off the trail.");
6287
return;
6388
}
6489
if (!data.hasCompleted(MissionTalkToLumberjackAgain.class)) {
6590
setDialogue(player, "spoke-again").thenRun(() -> {
66-
data.endMission(MissionTalkToLumberjackAgain.class);
91+
new GUIClaimReward(ItemType.PROMISING_AXE, () -> {
92+
data.endMission(MissionTalkToLumberjackAgain.class);
93+
}).open(player);
6794
});
6895
return;
6996
}
70-
7197
}
7298

7399
@Override
74100
public DialogueSet[] dialogues(HypixelPlayer player) {
75101
return List.of(
76-
DialogueSet.builder()
77-
.key("initial-hello").lines(new String[]{
78-
"Timber!",
79-
"My woodcutting assistant has fallen quite ill! Do you think you could take over for him?",
80-
"I just need you to chop down some Logs. If you do, I'll even give you his old axe as a reward!",
81-
"I just need you to chop down some Logs. If you do, I'll even give you his old axe as a reward!"
82-
}).build(),
83-
DialogueSet.builder()
84-
.key("spoke-again").lines(new String[]{
85-
"Thank you! Take this §aSweet Axe§f, it's so sweet that it drops apples from logs sometimes!",
86-
"You've got the knack for wood. Could you get some Birch Planks from §aBirch Park§f?",
87-
"My associate will be there waiting for you. He will reward you in §6Coins if you're up to the task!",
88-
"However, this time I will reforge any item for the low price of Coal §8x10!"
89-
}).build()
90-
).stream().toArray(DialogueSet[]::new);
102+
DialogueSet.builder()
103+
.key("initial-hello").lines(new String[]{
104+
"Timber!",
105+
"My woodcutting assistant has fallen quite ill! Do you think you could take over for him?",
106+
"I just need you to chop down some Logs. If you do, I'll even give you his old axe as a reward!",
107+
"Do you think you could take over for him?"
108+
}).build(),
109+
DialogueSet.builder().key("option-nah").lines(new String[]{
110+
"Oh okay... maybe come back later!"
111+
}).build(),
112+
DialogueSet.builder().key("option-accept").lines(new String[]{
113+
"Cheers!, Let me tell ya a little about what we're going to be doing.",
114+
"We will be §aForaging§f! As one of SkyBlock's core skills, Foraging involves cutting down lots of different types of trees!",
115+
"As you do this, you'll unlock various crafts and useful stat boots that will help in other areas of your adventure.",
116+
"Here, let me unlock the §aForaging skill for you, and then you can get started!",
117+
"To get you started, please bring me §a20 Oak Logs§f! You can break the trees just off the trail to get 'em",
118+
"§fUse your fists for now - I'll give you my previous assistant's axe if you can prove your worth!"
119+
}).build(),
120+
DialogueSet.builder()
121+
.key("spoke-again").lines(new String[]{
122+
"Nice job! In return for those logs, I'll give ya this §aPromising Axe§f.",
123+
"It's far less painful than using your fists to punch trees, I'll tell ya that much!",
124+
"If you feel like Foraging is the thin for you, continue down the path and head towards §aThe Park§f.",
125+
"My friend §eCharlie §fcan be found there. I'm sure he'll have some work for you!",
126+
}).build()
127+
).toArray(DialogueSet[]::new);
91128
}
92129
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/event/actions/custom/ActionNewZoneDisplay.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ public void run(PlayerRegionChangeEvent event) {
111111
"Talk to the farmer.", "Travel to The Barn.");
112112

113113
case BIRCH_PARK -> onNewZone(player, RegionType.BIRCH_PARK,
114-
"Chop down trees.",
115-
"Collect all Log types.");
114+
"Talk to Charlie.",
115+
"Chop down Birch logs.");
116116

117117
case FOREST -> onNewZone(player, RegionType.FOREST,
118-
"Visit the Lumberjack.",
118+
"Visit the §aLumber Jack.",
119119
"Chop down trees.",
120-
"Travel to the Birch Park.");
120+
"Travel to the §aBirch Park§f.");
121121

122122
case GRAVEYARD -> onNewZone(player, RegionType.GRAVEYARD,
123123
"Fight Zombies.",
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package net.swofty.type.skyblockgeneric.gui.inventories;
2+
3+
import net.minestom.server.event.inventory.InventoryCloseEvent;
4+
import net.minestom.server.event.inventory.InventoryPreClickEvent;
5+
import net.minestom.server.inventory.InventoryType;
6+
import net.minestom.server.item.ItemStack;
7+
import net.swofty.commons.skyblock.item.ItemType;
8+
import net.swofty.type.generic.gui.inventory.HypixelInventoryGUI;
9+
import net.swofty.type.generic.gui.inventory.ItemStackCreator;
10+
import net.swofty.type.generic.gui.inventory.item.GUIClickableItem;
11+
import net.swofty.type.generic.user.HypixelPlayer;
12+
import net.swofty.type.skyblockgeneric.item.SkyBlockItem;
13+
import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer;
14+
15+
import java.util.List;
16+
17+
public class GUIClaimReward extends HypixelInventoryGUI {
18+
19+
private final ItemType rewardItem;
20+
private final Runnable onClaim;
21+
22+
public GUIClaimReward(ItemType rewardItem, Runnable onClaim) {
23+
super("Claim Reward", InventoryType.CHEST_6_ROW);
24+
this.rewardItem = rewardItem;
25+
this.onClaim = onClaim;
26+
}
27+
28+
@Override
29+
public void onOpen(InventoryGUIOpenEvent e) {
30+
set(new GUIClickableItem(22) {
31+
@Override
32+
public void run(InventoryPreClickEvent e, HypixelPlayer p) {
33+
SkyBlockPlayer player = (SkyBlockPlayer) p;
34+
onClaim.run();
35+
SkyBlockItem item = new SkyBlockItem(rewardItem);
36+
player.addAndUpdateItem(item);
37+
player.sendMessage("§aYou claimed §f" + item.getDisplayName() + "§a!");
38+
}
39+
40+
@Override
41+
public ItemStack.Builder getItem(HypixelPlayer player) {
42+
return ItemStackCreator.appendLore(
43+
new SkyBlockItem(rewardItem).getDisplayItem(),
44+
List.of(
45+
"",
46+
"§eClick to claim!"
47+
)
48+
);
49+
}
50+
});
51+
set(GUIClickableItem.getCloseItem(49));
52+
updateItemStacks(getInventory(), getPlayer());
53+
}
54+
55+
@Override
56+
public boolean allowHotkeying() {
57+
return false;
58+
}
59+
60+
@Override
61+
public void onClose(InventoryCloseEvent e, CloseReason reason) {
62+
SkyBlockPlayer player = (SkyBlockPlayer) e.getPlayer();
63+
onClaim.run();
64+
player.addAndUpdateItem(rewardItem);
65+
}
66+
67+
@Override
68+
public void onBottomClick(InventoryPreClickEvent e) {
69+
e.setCancelled(true);
70+
}
71+
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/lumber/MissionBreakOaklog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ public Double getAttachedSkyBlockXP() {
6363

6464
@Override
6565
public int getMaxProgress() {
66-
return 10;
66+
return 20;
6767
}
6868
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/lumber/MissionTalkToLumberjackAgain.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import net.swofty.commons.skyblock.item.ItemType;
44
import net.swofty.type.skyblockgeneric.mission.MissionData;
55
import net.swofty.type.skyblockgeneric.mission.SkyBlockMission;
6+
import net.swofty.type.skyblockgeneric.mission.missions.thepark.MissionTravelToThePark;
67
import net.swofty.type.skyblockgeneric.region.RegionType;
78
import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer;
89

@@ -18,7 +19,7 @@ public String getID() {
1819

1920
@Override
2021
public String getName() {
21-
return "Talk to the Lumber Jack";
22+
return "Give Lumber Jack Oak Logs";
2223
}
2324

2425
@Override
@@ -29,7 +30,8 @@ public Map<String, Object> onStart(SkyBlockPlayer player, MissionData.ActiveMiss
2930

3031
@Override
3132
public void onEnd(SkyBlockPlayer player, Map<String, Object> customData, MissionData.ActiveMission mission) {
32-
player.addAndUpdateItem(ItemType.SWEET_AXE);
33+
player.addAndUpdateItem(ItemType.PROMISING_AXE);
34+
player.getMissionData().startMission(MissionTravelToThePark.class);
3335
}
3436

3537
@Override

0 commit comments

Comments
 (0)