Automatically activate NW goliath #11

Merged
atomaka merged 2 commits from activate-goliath into master 2021-02-20 19:56:03 -05:00
Showing only changes of commit 35bcc5b220 - Show all commits

View file

@ -9,6 +9,18 @@ StaticPopupDialogs["REPAIR_ALERT"] = {
preferredIndex = 3 preferredIndex = 3
} }
StaticPopupDialogs["GOLIATH_MISSING"] = {
text = "Option to repair goliath not found; move closer",
button1 = "Ok",
OnAccept = function()
C_GossipInfo.CloseGossip()
end,
timeout = 5,
whileDead = false,
hideOnEscape = true,
preferredIndex = 3
}
MyAddon.keyItemID = 180653 MyAddon.keyItemID = 180653
MyAddon.taunts = { MyAddon.taunts = {
[56222] = true, -- Dark Command [56222] = true, -- Dark Command
@ -27,6 +39,10 @@ function MyAddon.OnEvent(self, event, ...)
events[event](self, ...) events[event](self, ...)
end end
function events:GOSSIP_SHOW()
if GetZoneText() == 'The Necrotic Wake' then MyAddon.activateGoliath() end
end
function events:CHAT_MSG_PARTY_LEADER(message, ...) function events:CHAT_MSG_PARTY_LEADER(message, ...)
if message == '!keys' then if message == '!keys' then
MyAddon.announceKey() MyAddon.announceKey()
@ -102,6 +118,21 @@ function MyAddon.announceTaunts(...)
print(message) print(message)
end end
function MyAddon.activateGoliath()
options = C_GossipInfo.GetOptions()
found = false
for k, v in pairs(options) do
if v['name'] == 'Can you reactivate this goliath?' then
found = true
C_GossipInfo.SelectOption(k)
break
end
end
if not found then StaticPopup_Show("GOLIATH_MISSING") end
end
function MyAddon.needsRepair() function MyAddon.needsRepair()
local slots = { local slots = {
"HeadSlot", "ShoulderSlot", "ChestSlot", "WristSlot", "HandsSlot", "HeadSlot", "ShoulderSlot", "ChestSlot", "WristSlot", "HandsSlot",