How quests work in VMaNGOS: the master quest_template table, the
tables that attach quests to the world, and the character-side progress tables.
All quest definition lives in quest_template. The most important
field groups:
| Group | Fields |
|---|---|
| Identity | entry, patch (progression), Title, Details, text fields |
| Availability | MinLevel, MaxLevel, QuestLevel, RequiredClasses, RequiredRaces, RequiredSkill(Value), RequiredCondition, reputation min/max pairs |
| Objectives | ReqItemId1-4 (+count), ReqCreatureOrGOId1-4 (+counts), ReqSpellCast1-4, kill credit fields |
| Flow control | PrevQuestId, NextQuestId, ExclusiveGroup, BreadcrumbForQuestId, NextQuestInChain, SpecialFlags, QuestFlags, LimitTime |
| Rewards | RewItemId1-4, choice items, RewOrReqMoney, XP, honour, spell rewards, mail templates |
| Starter text/items | SrcItemId/Count/Spell - given on accept |
Objectives are validated at load: referenced items/creatures/gameobjects must exist.
| Table | Purpose |
|---|---|
creature_questrelation |
Quest givers (NPCs offering the quest). |
creature_involvedrelation |
Quest enders (NPCs to turn in to). |
gameobject_questrelation / gameobject_involvedrelation |
Same for objects. |
quest_greeting |
Custom greeting text/emotes for quest NPCs. |
points_of_interest |
Map markers shown by gossip options pointing players toward objectives. |
Scripts can interact with quests via these DB script commands: 7 QUEST_EXPLORED,
70 FAIL_QUEST and 83 QUEST_CREDIT
(see DB Script Tables).
Stored per player in the characters database:
| Table | Contents |
|---|---|
character_queststatus |
Accepted/rewarded quests, kill counters, timers. |
character_spell_cooldown |
Cooldowns (also used for timed quests). |
character_reputation |
Reputation gates checked on offer. |
RequiredCondition gates availability with a conditions row; EventAI can
react to quest lifecycle via EVENT_T_QUEST_ACCEPT / EVENT_T_QUEST_COMPLETE
(EventAI types).