You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.4 KiB

local _, addon = ...
local DARKMOON_GOSSIP = {
[40007] = true, -- Darkmoon Faire Mystic Mage (Horde)
[40457] = true, -- Darkmoon Faire Mystic Mage (Alliance)
}
local QUEST_GOSSIP = {
-- usually only addeed if they're repeatable
[109275] = true, -- Soridormi - begin time rift
[120619] = true, -- Big Dig task
[120620] = true, -- Big Dig task
-- Darkmoon Faire
[40563] = true, -- whack
[28701] = true, -- cannon
[31202] = true, -- shoot
[39245] = true, -- tonk
[40224] = true, -- ring toss
[43060] = true, -- firebird
[52651] = true, -- dance
[41759] = true, -- pet battle 1
[42668] = true, -- pet battle 2
[40872] = true, -- cannon return (Teleportologist Fozlebub)
}
local IGNORE_GOSSIP = {
-- when we don't want to automate gossip because it's counter-intuitive
[122442] = true, -- leave the dungeon in remix
}
function addon:GOSSIP_SHOW()
if addon:IsPaused() or addon:IsNPCIgnored() then
return
end
if C_PlayerInteractionManager.IsInteractingWithNpcOfType(Enum.PlayerInteractionType.TaxiNode) then
-- don't annoy taxi addons
return
end
local gossip = C_GossipInfo.GetOptions()
for _, info in next, gossip do
if DARKMOON_GOSSIP[info.gossipOptionID] and addon:GetOption('paydarkmoonfaire') then
C_GossipInfo.SelectOption(info.gossipOptionID, '', true)
elseif QUEST_GOSSIP[info.gossipOptionID] and addon:GetOption('autoquestgossip') then
C_GossipInfo.SelectOption(info.gossipOptionID)
elseif FlagsUtil.IsSet(info.flags, Enum.GossipOptionRecFlags.QuestLabelPrepend) and addon:GetOption('autoquestgossip') then
C_GossipInfo.SelectOption(info.gossipOptionID)
end
end
if (C_GossipInfo.GetNumActiveQuests() + C_GossipInfo.GetNumAvailableQuests()) > 0 then
-- don't automate misc gossip if the NPC is a quest giver
return
end
if #gossip ~= 1 then
-- more than 1 option
return
end
if not addon:GetOption('skipgossip') then
return
end
if not gossip[1].gossipOptionID then
-- intentionally blocked gossip
return
end
if IGNORE_GOSSIP[gossip[1].gossipOptionID] then
return
end
local _, instanceType = GetInstanceInfo()
if instanceType == 'raid' and addon:GetOption('skipgossipwhen') > 1 then
if GetNumGroupMembers() <= 1 or addon:GetOption('skipgossipwhen') == 3 then
C_GossipInfo.SelectOption(gossip[1].gossipOptionID)
end
elseif instanceType ~= 'raid' then
C_GossipInfo.SelectOption(gossip[1].gossipOptionID)
end
end