Quests
Relevant source files
The following files were used as context for generating this wiki page:
- core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java
- core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java
- core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java
- core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java
- core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java
- core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v2_X_Changes.java
- core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java
Quests are optional side-missions given by various Non-Player Characters (NPCs) found throughout the dungeon. These missions provide players with challenges and valuable rewards, such as upgraded equipment, unique items, or access to special services. Each major region of the dungeon features a distinct quest associated with a specific NPC.
The primary quest-givers are the Sad Ghost, the Wandmaker, the Troll Blacksmith, and the Ambitious Imp. Each quest has its own unique mechanics, objectives, and state management, which are tracked throughout a run. Completing these quests is often crucial for a successful run, as the rewards can significantly boost the hero's power.
Quest Management
The state of all major quests is managed through static nested Quest classes within their respective NPC controller classes (e.g., Ghost.Quest, Wandmaker.Quest). The main Dungeon class orchestrates the saving, loading, and resetting of these quest states for each run.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java:231-234, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java:436-440
Quest State Architecture
The following diagram illustrates how the Dungeon class interacts with the static Quest classes of each NPC to manage their state.
This diagram shows the Dungeon class's role in managing the lifecycle of each quest's state through a common interface of reset(), storeInBundle(), and restoreFromBundle() methods.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java:231-234, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java:214, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java:241
Quest Summary
| Quest Giver | Region | Objective | Reward |
|---|---|---|---|
| Sad Ghost | Sewers (Floors 2-4) | Defeat a powerful enemy. | A choice between an upgraded weapon or armor. |
| Wandmaker | Prison (Floors 7-9) | Varies (Corpse Dust, Embers, or Rotberry). | A choice between two different upgraded wands. |
| Troll Blacksmith | Caves (Floors 12-14) | Mine Dark Gold Ore in a sub-level. | Blacksmithing services (reforge, enchant, etc.). |
| Ambitious Imp | Metropolis (Floor 17-19) | Collect 15 Demonite Ore. | Access to the Imp's special shop. |
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v2_X_Changes.java:825-837
Sad Ghost Quest
The Sad Ghost is found in the Sewers region, on floors 2, 3, or 4. The ghost is always located in the exit room of the level. Upon interaction, the ghost asks the hero to defeat a powerful monster that has disturbed its rest. After the player defeats the designated boss mob, they can return to the ghost to claim a reward.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java:101-112, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v2_X_Changes.java:891-892
Interaction Flow
The sequence diagram below outlines the process of completing the Sad Ghost's quest.
This diagram shows the hero receiving the quest, defeating the boss, and interacting with the ghost again to open the reward window and complete the quest.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java:101-112, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java:62-75
Reward
The reward is a choice between two pieces of equipment: one weapon and one armor. The player selects their preferred item from the WndSadGhost window. The chance for the reward to be enchanted is 20%.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java:49-55, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v2_X_Changes.java:708-709
Dried Rose Interaction
Completing the Sad Ghost quest is a prerequisite for using the DriedRose artifact. The artifact's ability to summon a GhostHero ally can only be activated after Ghost.Quest.completed() returns true.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java:119-122
Wandmaker Quest
The Wandmaker appears in the Prison region (floors 7-9) and offers a quest in exchange for an upgraded wand. The quest is randomly chosen from one of three variants when the level is generated.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java:244-247, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java:342-345
Quest Variants
The specific quest type is determined by the type variable in the Wandmaker.Quest static class.
| Type ID | Quest Name | Objective | Quest Item | Special Room |
|---|---|---|---|---|
| 1 | Corpse Dust | Survive being haunted by wraiths. | CorpseDust | MassGraveRoom |
| 2 | Elemental Embers | Summon and defeat a Newborn Elemental. | Embers | RitualSiteRoom |
| 3 | Rotberry | Defeat the Rot Heart to get its seed. | Rotberry.Seed | RotGardenRoom |
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java:118-129, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java:245, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java:350-360
Quest Flow
The following flowchart shows the logic for spawning and completing the Wandmaker's quest.
This diagram illustrates the process from quest generation to completion, including the random selection of the quest type and the final reward selection.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java:109-152, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java:340-362
Blacksmith Quest
The Troll Blacksmith quest was completely overhauled in version 2.2.0. It now takes place in a new sub-level within the Caves region. The player must mine Dark Gold Ore and return it to the blacksmith to earn "favor," which can be exchanged for various smithing services.
The quest reward system is expanded beyond the old reforge option, offering several new services. The quality of the rewards is tied to the amount of favor earned.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v2_X_Changes.java:825-837
Ambitious Imp Quest
The Ambitious Imp is found in the Dwarven Metropolis and tasks the hero with collecting 15 DemoniteOre. Once the ore is collected and returned, the Imp opens a shop with four items for sale. The quest state is tracked in the Imp.Quest static class. If the player talks to the Imp after collecting the ore, the WndImpShop is displayed.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java:83-100
Other Quests & Interactions
Rare Enemies
Certain rare enemies offer unique interactions that function like mini-quests.
- Tormented Spirits: A rare variant of Wraiths. Using a Scroll of Remove Curse on them peacefully defeats them and grants an uncursed equipment reward.
- Gnoll Exiles: A rare, non-hostile Gnoll in the sewers. They can be left alone, but drop valuable loot if defeated.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v2_X_Changes.java:986-990, core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v3_X_Changes.java:625-630
Conclusion
The quest system in Shattered Pixel Dungeon provides significant depth and replayability. Each quest is designed to fit the theme of its respective dungeon region and offers substantial rewards that can define a player's strategy for the remainder of the game. The management of quest states is robust, ensuring that progress is saved and restored correctly across game sessions. Future updates, such as the planned overhaul for the Ambitious Imp quest, indicate that quests will continue to be a core area of development and expansion.
Sources: core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v3_X_Changes.java:68-75