2021-03-09 22:58:50 -05:00
|
|
|
local f = CreateFrame("Frame")
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
f:RegisterEvent("GOSSIP_SHOW")
|
|
|
|
|
|
|
|
f:SetScript("OnEvent", function(self, event, ...)
|
2021-04-14 09:37:18 -04:00
|
|
|
-- check if The Necrotic Wake
|
|
|
|
local isNecroticWake = C_Map.GetBestMapForUnit("player") == 1666
|
|
|
|
-- check if Steward
|
|
|
|
local guid = UnitGUID("npc")
|
|
|
|
local isSteward = tonumber(guid and strsub(guid, 27, 32)) == 166663
|
2021-03-09 22:58:50 -05:00
|
|
|
|
|
|
|
if isNecroticWake and isSteward then
|
|
|
|
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
|
|
|
|
end)
|