diff --git a/LegionWA/AutoQuest/Event.lua b/LegionWA/AutoQuest/Event.lua new file mode 100644 index 0000000..0ed4f37 --- /dev/null +++ b/LegionWA/AutoQuest/Event.lua @@ -0,0 +1,42 @@ +-- QUEST_POI_UPDATE QUEST_DETAIL QUEST_COMPLETE QUEST_GREETING QUEST_PROGRESS GOSSIP_SHOW +function(e) + if e == "QUEST_POI_UPDATE" then + CloseGossip() + elseif e == "QUEST_DETAIL" then + AcceptQuest() + elseif e == "QUEST_COMPLETE" then + if GetNumQuestChoices() <= 1 then + GetQuestReward(1) + end + elseif e == "GOSSIP_SHOW" then + local quests = GetNumGossipAvailableQuests() + local completedQuests = GetNumGossipActiveQuests() + local options = GetNumGossipoptionsions() + if completedQuests > 0 and options == 0 then + for i = 1, completedQuests do + SelectGossipActiveQuest(i) + end + end + if quests > 0 and options == 0 then + SelectGossipAvailableQuest(1) + end + if options == 1 and quests + completedQuests == 0 then + SelectGossipoptionsion(1) + end + elseif e == "QUEST_GREETING" then + local quests = GetNumGossipAvailableQuests() + local completedQuests = GetNumGossipActiveQuests() + if completedQuests > 0 then + for i = 1, completedQuests do + SelectActiveQuest(1) + end + end + if quests > 0 then + SelectAvailableQuest(1) + end + elseif e == "QUEST_PROGRESS" then + if IsQuestCompletable(i) then + CompleteQuest() + end + end +end \ No newline at end of file