Let me know if this makes any sense at all.
Player has a "Quest List" and each quest entry has a QuestFlag and Quest Value. Server keeps track of a Master Quest List with quest name, description, how many flags a quest has, and the value of each flag. NPCs, Items, possibly map tiles and anything else quest related has a Quest Flag value and Quest Number tied to what part of the quest the event/object happens in.
The player quest flag for a single quest entry starts at QuestFlag = 0 and QuestValue = 0. When the player finds the quest trigger (item, NPC with QuestFlag = 1) that corresponds to QuestFlag, his QuestFlag is set to 1 and his Quest Value for that Flag is set to the value it needs to be (for most Flags that trigger the quest [QuestFlag = 1] the value is 0 so it can go straight to the next part of the quest, usually collecting or running errands). If the player does not have a quest entry of 0 then he or she has either already completed the quest or is currently on it.
Next the player starts the next flag of the quest, such as killing the first monster. the player flag is set to the next sequence, and the value tied to that flag is set to what the master quest entry's is. After the player kills another monster, the player is already on that flag, so instead his quest value is reduced by 1. Once it reaches zero he goes to the next part of the chain, until he reaches the end where he receives a reward.
The player completes quests by getting the current flag's value down to 0, depending on what needs to be done (running errands, killing monsters, collecting item, traveling, etc.) Once it is = 0 then the player can complete that part of the sequence and move on. Players also can't skip flags, they must go in sequential order.
_________________
|