mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 00:53:52 +00:00
feat(editor): quest editor with objectives, rewards, and quest chains
- New Quest mode (key 6) with full quest creation panel: - Title, description, required level - Quest giver / turn-in NPC ID linkage - Up to 4 objectives: Kill, Collect, Talk, Explore, Escort, Use Object - Rewards: XP and gold - Quest chain support via nextQuestId linking - Quest list showing all created quests with level and objective count - Save quests to JSON (included in Export Zone package) - Foundation for campaign system: create quest chains across NPCs, link objectives to placed creatures, build storylines
This commit is contained in:
parent
124ff5a54a
commit
f59d79537a
7 changed files with 239 additions and 2 deletions
67
tools/editor/quest_editor.hpp
Normal file
67
tools/editor/quest_editor.hpp
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
|
||||
enum class QuestObjectiveType {
|
||||
KillCreature,
|
||||
CollectItem,
|
||||
TalkToNPC,
|
||||
ExploreArea,
|
||||
EscortNPC,
|
||||
UseObject
|
||||
};
|
||||
|
||||
struct QuestObjective {
|
||||
QuestObjectiveType type = QuestObjectiveType::KillCreature;
|
||||
std::string description;
|
||||
std::string targetName;
|
||||
uint32_t targetCount = 1;
|
||||
};
|
||||
|
||||
struct QuestReward {
|
||||
uint32_t xp = 100;
|
||||
uint32_t gold = 0;
|
||||
uint32_t silver = 0;
|
||||
uint32_t copper = 0;
|
||||
std::vector<std::string> itemRewards;
|
||||
};
|
||||
|
||||
struct Quest {
|
||||
uint32_t id = 0;
|
||||
std::string title = "New Quest";
|
||||
std::string description;
|
||||
std::string completionText;
|
||||
uint32_t requiredLevel = 1;
|
||||
uint32_t questGiverNpcId = 0;
|
||||
uint32_t turnInNpcId = 0;
|
||||
std::vector<QuestObjective> objectives;
|
||||
QuestReward reward;
|
||||
uint32_t nextQuestId = 0; // chain link
|
||||
};
|
||||
|
||||
class QuestEditor {
|
||||
public:
|
||||
void addQuest(const Quest& q);
|
||||
void removeQuest(int index);
|
||||
Quest* getQuest(int index);
|
||||
const std::vector<Quest>& getQuests() const { return quests_; }
|
||||
size_t questCount() const { return quests_.size(); }
|
||||
|
||||
bool saveToFile(const std::string& path) const;
|
||||
|
||||
Quest& getTemplate() { return template_; }
|
||||
|
||||
private:
|
||||
std::vector<Quest> quests_;
|
||||
Quest template_;
|
||||
uint32_t nextId_ = 1;
|
||||
};
|
||||
|
||||
} // namespace editor
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue