Skip to content

Commit

Permalink
feat: make the auto chat handles some special quest
Browse files Browse the repository at this point in the history
  • Loading branch information
fang2hou committed Aug 11, 2024
1 parent be262d5 commit 6b8f2e3
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions Modules/Quest/TurnIn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -379,23 +379,26 @@ function TI:GOSSIP_SHOW()
end
elseif self.db and self.db.followerAssignees and followerAssignees[npcID] and numGossipOptions > 1 then
return C_GossipInfo_SelectOption(firstGossipOptionID)
elseif numGossipOptions > 1 then
local maybeQuestIndexes = {}
for index, gossipOption in ipairs(gossipOptions) do
if
gossipOption.name and
(gossipOption.flags == Enum_GossipOptionRecFlags_QuestLabelPrepend or
strfind(gossipOption.name, "^|cFF0000FF"))
then
tinsert(maybeQuestIndexes, index)
end
end
end

if numGossipOptions > 0 then
local maybeQuestIndexes = {}
for index, gossipOption in ipairs(gossipOptions) do
if
gossipOption.name and
(gossipOption.flags == Enum_GossipOptionRecFlags_QuestLabelPrepend or
strfind(gossipOption.name, "^|cFF0000FF"))
then
tinsert(maybeQuestIndexes, index)
end
if #maybeQuestIndexes == 1 then
local index = maybeQuestIndexes[1]
local status = gossipOptions[index] and gossipOptions[index].status
if status and status == 0 then
return C_GossipInfo_SelectOption(gossipOptions[index].gossipOptionID)
end
end

if #maybeQuestIndexes == 1 then
local index = maybeQuestIndexes[1]
local status = gossipOptions[index] and gossipOptions[index].status
if status and status == 0 then
return C_GossipInfo_SelectOption(gossipOptions[index].gossipOptionID)
end
end
end
Expand Down

0 comments on commit 6b8f2e3

Please sign in to comment.