Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void convert_quests(player) {
- local new_quests = {}
- local quest_entries = {}
- local quest_data = {}
- for quest, progress in player.quest {
- local quest_definition = find_quest_data(quest)
- if not quest_definition {
- continue;
- }
- if get_level(player) > quest_definition.level_expire {
- continue;
- }
- local quest_object = {
- uuid = generate_uuid(),
- id = quest_definition.id
- }
- local data = {}
- quest_data[quest_object.uuid] = data
- quest_entries.push_back(quest_object)
- if quest_definition.is_accumulate {
- data.progress = progress
- } else {
- data.best = progress
- }
- if quest_definition.tutorial_marker {
- update_tutorial_progress(player, quest_definition.tutorial_marker, progress)
- }
- if quest_definition.goal <= progress {
- complete_quest_and_give_reward(player, quest_object.id)
- }
- }
- player.quests = nil
- player.quest_entries = quest_entries;
- player.quest_data = quest_data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement