Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@ public enum ItemType {
MINER_ARMOR_LEGGINGS(Material.IRON_LEGGINGS, Rarity.RARE),
MINER_ARMOR_BOOTS(Material.IRON_BOOTS, Rarity.RARE),

CHARLIE_TROUSERS(Material.LEATHER_LEGGINGS, Rarity.COMMON),

/**
* Pickaxes
*/
Expand Down Expand Up @@ -743,6 +745,8 @@ public enum ItemType {
HUB_DARK_AUCTION_TRAVEL_SCROLL(Material.MAP, Rarity.EPIC),
HUB_CRYPTS_TRAVEL_SCROLL(Material.MAP, Rarity.EPIC),

FORAGING_1_TRAVEL_SCROLL(Material.MAP, Rarity.RARE),

/**
* Crimson Isles
*/
Expand Down
19 changes: 19 additions & 0 deletions configuration/skyblock/items/armor/thepark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
items:
- id: CHARLIE_TROUSERS
rarity: COMMON
default_statistics:
defense: 15
health: 45
foraging_fortune: 6
components:
- id: CUSTOM_DISPLAY_NAME
display_name: Charlie's Trousers
- id: STANDARD_ITEM
standard_item_type: HELMET
- id: LEATHER_COLOR
r: '20'
g: '121'
b: '100'
- id: TRACKED_UNIQUE
- id: MUSEUM
museum_category: ARMOR_SETS
6 changes: 6 additions & 0 deletions configuration/skyblock/items/travelscroll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ items:
components:
- id: TRAVEL_SCROLL
scroll_type: HUB_DARK_AUCTION
- id: FORAGING_1_TRAVEL_SCROLL
material: PAPER
rarity: RARE
components:
- id: TRAVEL_SCROLL
scroll_type: THE_PARK
- id: HUB_CRYPTS_TRAVEL_SCROLL
material: PAPER
rarity: UNCOMMON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,23 @@ public static ItemStack.Builder updateLore(ItemStack.Builder builder, List<Strin
.set(DataComponents.TOOLTIP_DISPLAY, DEFAULT_TOOLTIP_DISPLAY));
}

/**
* Appends lore lines to the existing lore of the given {@link ItemStack.Builder}.
*
* @param builder the {@link ItemStack.Builder} to modify
* @param lore the lore lines to append
* @return the modified {@link ItemStack.Builder}
*/
public static ItemStack.Builder appendLore(ItemStack.Builder builder, List<String> lore) {
List<Component> existingLore = builder.build().get(DataComponents.LORE);
for (String s : lore) {
existingLore.add(Component.text(color(s)).decoration(TextDecoration.ITALIC, false));
}

return clearAttributes(builder.set(DataComponents.LORE, existingLore)
.set(DataComponents.TOOLTIP_DISPLAY, DEFAULT_TOOLTIP_DISPLAY));
}

/**
* Marks the given {@link ItemStack.Builder} as not editable.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public LoaderValues getLoaderValues() {
case SKYBLOCK_SPIDERS_DEN -> new Pos(-159.5, 73, -158.5, -45, 0);
case SKYBLOCK_GOLD_MINE -> new Pos(-9.5, 64, -228.5, 0, 0);
case SKYBLOCK_DUNGEON_HUB -> new Pos(-44, 88, 11.5, 0, 0);
default -> new Pos(-2.5, 72.5, -69.5, 180, 0);
default -> new Pos(-2.5, 70, -69.5, 180, 0);
}, // Spawn position
true // Announce death messages
);
Expand Down
81 changes: 59 additions & 22 deletions type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberJack.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package net.swofty.type.hub.npcs;

import net.kyori.adventure.text.format.NamedTextColor;
import net.minestom.server.coordinate.Pos;
import net.swofty.commons.skyblock.item.ItemType;
import net.swofty.type.generic.entity.npc.HypixelNPC;
import net.swofty.type.generic.entity.npc.NPCOption;
import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration;
import net.swofty.type.generic.user.HypixelPlayer;
import net.swofty.type.skyblockgeneric.gui.inventories.GUIClaimReward;
import net.swofty.type.skyblockgeneric.mission.MissionData;
import net.swofty.type.skyblockgeneric.mission.missions.lumber.MissionBreakOaklog;
import net.swofty.type.skyblockgeneric.mission.missions.lumber.MissionTalkToLumberjack;
Expand All @@ -20,17 +24,17 @@ public NPCLumberJack() {
super(new HumanConfiguration() {
@Override
public String[] holograms(HypixelPlayer player) {
return new String[]{"Lumber Jack", "§e§lCLICK"};
return new String[]{"§aLumber Jack", "§e§lCLICK"};
}

@Override
public String signature(HypixelPlayer player) {
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=";
return "cxEDP/ZmKhHdhmmHUgbqSxSgoD8w/wQk3IysGKDggfZUR3tsd1BFqpwsE37pv1LUsUkHr+mF0R6aAC0ZWQzT5kMT1546s5JAyRPFNa4P9iScE+aWlPCK1iqw2tMDqD73hYRtlSKuDRlxjbKXbHBltAsZ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IiwicHJvZmlsZU5hbWUiOiJiUHVuY2giLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzY4MjUwMzBlNzc1MmZhZjdmODE2YWMyYTIwYjExNDMyYWY0YjJjZGU0OTMyZGMwZTkyMDgzMWU2MjE4MDhlZTgifX19";
}

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

if (data.isCurrentlyActive(MissionTalkToLumberjack.class)) {
setDialogue(player, "initial-hello").thenRun(() -> {
data.endMission(MissionTalkToLumberjack.class);
NPCOption.sendOption(player, "lumber_jack", List.of(
new NPCOption.Option(
"r_2_1",
NamedTextColor.GREEN,
false,
"Sure",
(p) -> {
setDialogue(p, "option-accept").thenRun(() -> {
data.endMission(MissionTalkToLumberjack.class);
});
}
),
new NPCOption.Option(
"r_2_2",
NamedTextColor.RED,
false,
"Nah, I'm good",
(p) -> {
setDialogue(player, "option-nah");
}
)
));
});
return;
}
if (!data.hasCompleted(MissionBreakOaklog.class)) {
player.sendMessage("Bring me some Logs. You can chop them down in this Forest!");
sendNPCMessage(player, "Please collect and then bring to me §a20 Oak Logs§f! You can get 'em from the §bForest §fjust off the trail.");
return;
}
if (!data.hasCompleted(MissionTalkToLumberjackAgain.class)) {
setDialogue(player, "spoke-again").thenRun(() -> {
data.endMission(MissionTalkToLumberjackAgain.class);
new GUIClaimReward(ItemType.PROMISING_AXE, () -> {
data.endMission(MissionTalkToLumberjackAgain.class);
}).open(player);
});
return;
}

}

@Override
public DialogueSet[] dialogues(HypixelPlayer player) {
return List.of(
DialogueSet.builder()
.key("initial-hello").lines(new String[]{
"Timber!",
"My woodcutting assistant has fallen quite ill! Do you think you could take over for him?",
"I just need you to chop down some Logs. If you do, I'll even give you his old axe as a reward!",
"I just need you to chop down some Logs. If you do, I'll even give you his old axe as a reward!"
}).build(),
DialogueSet.builder()
.key("spoke-again").lines(new String[]{
"Thank you! Take this §aSweet Axe§f, it's so sweet that it drops apples from logs sometimes!",
"You've got the knack for wood. Could you get some Birch Planks from §aBirch Park§f?",
"My associate will be there waiting for you. He will reward you in §6Coins if you're up to the task!",
"However, this time I will reforge any item for the low price of Coal §8x10!"
}).build()
).stream().toArray(DialogueSet[]::new);
DialogueSet.builder()
.key("initial-hello").lines(new String[]{
"Timber!",
"My woodcutting assistant has fallen quite ill! Do you think you could take over for him?",
"I just need you to chop down some Logs. If you do, I'll even give you his old axe as a reward!",
"Do you think you could take over for him?"
}).build(),
DialogueSet.builder().key("option-nah").lines(new String[]{
"Oh okay... maybe come back later!"
}).build(),
DialogueSet.builder().key("option-accept").lines(new String[]{
"Cheers!, Let me tell ya a little about what we're going to be doing.",
"We will be §aForaging§f! As one of SkyBlock's core skills, Foraging involves cutting down lots of different types of trees!",
"As you do this, you'll unlock various crafts and useful stat boots that will help in other areas of your adventure.",
"Here, let me unlock the §aForaging skill for you, and then you can get started!",
"To get you started, please bring me §a20 Oak Logs§f! You can break the trees just off the trail to get 'em",
"§fUse your fists for now - I'll give you my previous assistant's axe if you can prove your worth!"
}).build(),
DialogueSet.builder()
.key("spoke-again").lines(new String[]{
"Nice job! In return for those logs, I'll give ya this §aPromising Axe§f.",
"It's far less painful than using your fists to punch trees, I'll tell ya that much!",
"If you feel like Foraging is the thin for you, continue down the path and head towards §aThe Park§f.",
"My friend §eCharlie §fcan be found there. I'm sure he'll have some work for you!",
}).build()
).toArray(DialogueSet[]::new);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ public void run(PlayerRegionChangeEvent event) {
"Talk to the farmer.", "Travel to The Barn.");

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

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

case GRAVEYARD -> onNewZone(player, RegionType.GRAVEYARD,
"Fight Zombies.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package net.swofty.type.skyblockgeneric.gui.inventories;

import net.minestom.server.event.inventory.InventoryCloseEvent;
import net.minestom.server.event.inventory.InventoryPreClickEvent;
import net.minestom.server.inventory.InventoryType;
import net.minestom.server.item.ItemStack;
import net.swofty.commons.skyblock.item.ItemType;
import net.swofty.type.generic.gui.inventory.HypixelInventoryGUI;
import net.swofty.type.generic.gui.inventory.ItemStackCreator;
import net.swofty.type.generic.gui.inventory.item.GUIClickableItem;
import net.swofty.type.generic.user.HypixelPlayer;
import net.swofty.type.skyblockgeneric.item.SkyBlockItem;
import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer;

import java.util.List;

public class GUIClaimReward extends HypixelInventoryGUI {

private final ItemType rewardItem;
private final Runnable onClaim;

public GUIClaimReward(ItemType rewardItem, Runnable onClaim) {
super("Claim Reward", InventoryType.CHEST_6_ROW);
this.rewardItem = rewardItem;
this.onClaim = onClaim;
}

@Override
public void onOpen(InventoryGUIOpenEvent e) {
set(new GUIClickableItem(22) {
@Override
public void run(InventoryPreClickEvent e, HypixelPlayer p) {
SkyBlockPlayer player = (SkyBlockPlayer) p;
onClaim.run();
SkyBlockItem item = new SkyBlockItem(rewardItem);
player.addAndUpdateItem(item);
player.sendMessage("§aYou claimed §f" + item.getDisplayName() + "§a!");
}

@Override
public ItemStack.Builder getItem(HypixelPlayer player) {
return ItemStackCreator.appendLore(
new SkyBlockItem(rewardItem).getDisplayItem(),
List.of(
"",
"§eClick to claim!"
)
);
}
});
set(GUIClickableItem.getCloseItem(49));
updateItemStacks(getInventory(), getPlayer());
}

@Override
public boolean allowHotkeying() {
return false;
}

@Override
public void onClose(InventoryCloseEvent e, CloseReason reason) {
SkyBlockPlayer player = (SkyBlockPlayer) e.getPlayer();
onClaim.run();
player.addAndUpdateItem(rewardItem);
}

@Override
public void onBottomClick(InventoryPreClickEvent e) {
e.setCancelled(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ public Double getAttachedSkyBlockXP() {

@Override
public int getMaxProgress() {
return 10;
return 20;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.swofty.commons.skyblock.item.ItemType;
import net.swofty.type.skyblockgeneric.mission.MissionData;
import net.swofty.type.skyblockgeneric.mission.SkyBlockMission;
import net.swofty.type.skyblockgeneric.mission.missions.thepark.MissionTravelToThePark;
import net.swofty.type.skyblockgeneric.region.RegionType;
import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer;

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

@Override
public String getName() {
return "Talk to the Lumber Jack";
return "Give Lumber Jack Oak Logs";
}

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

@Override
public void onEnd(SkyBlockPlayer player, Map<String, Object> customData, MissionData.ActiveMission mission) {
player.addAndUpdateItem(ItemType.SWEET_AXE);
player.addAndUpdateItem(ItemType.PROMISING_AXE);
player.getMissionData().startMission(MissionTravelToThePark.class);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package net.swofty.type.skyblockgeneric.mission.missions.thepark;

import net.swofty.type.skyblockgeneric.mission.MissionData;
import net.swofty.type.skyblockgeneric.mission.SkyBlockMission;
import net.swofty.type.skyblockgeneric.region.RegionType;
import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer;

import java.util.Map;
import java.util.Set;

public class MissionClaimTheTrousers extends SkyBlockMission {

@Override
public String getID() {
return "claim_charlie_trousers";
}

@Override
public String getName() {
return "Claim the trousers from Charlie!";
}

@Override
public Map<String, Object> onStart(SkyBlockPlayer player, MissionData.ActiveMission mission) {
mission.getNewObjectiveText().forEach(player::sendMessage);
return Map.of();
}

@Override
public void onEnd(SkyBlockPlayer player, Map<String, Object> customData, MissionData.ActiveMission mission) {
player.getMissionData().startMission(MissionTalkToCharlie.class);
}

@Override
public Set<RegionType> getValidRegions() {
return Set.of(RegionType.BIRCH_PARK);
}
}
Loading