Skip to content

Commit

Permalink
Fixed npcID for AutoAccept.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetxius committed Nov 20, 2014
1 parent ab0ceb6 commit d431f26
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions ShestakUI/Modules/Quests/AutoAccept.lua
Expand Up @@ -56,11 +56,8 @@ local function IsGossipQuestTrivial(index)
return not not select(((index * 6) - 6) + 3, GetGossipAvailableQuests()) return not not select(((index * 6) - 6) + 3, GetGossipAvailableQuests())
end end


local function GetCreatureID() local function GetNPCID()
local type, _, _, _, _, id = string.split(":", UnitGUID("npc") or "") return tonumber(string.match(UnitGUID('npc') or '', 'Creature%-.-%-.-%-.-%-.-%-(.-)%-'))
if type == "Creature" and id and tonumber(id) then
return tonumber(id)
end
end end


Monomyth:Register("GOSSIP_SHOW", function() Monomyth:Register("GOSSIP_SHOW", function()
Expand Down Expand Up @@ -91,8 +88,8 @@ Monomyth:Register("GOSSIP_SHOW", function()
end end
end end


local creatureID = GetCreatureID() local npcID = GetNPCID()
if creatureID and creatureID == 57850 then if npcID and npcID == 57850 then
SelectGossipOption(1) SelectGossipOption(1)
end end
end) end)
Expand All @@ -104,8 +101,8 @@ local darkmoonNPC = {
} }


Monomyth:Register("GOSSIP_CONFIRM", function(index) Monomyth:Register("GOSSIP_CONFIRM", function(index)
local creatureID = GetCreatureID() local npcID = GetNPCID()
if creatureID and darkmoonNPC[creatureID] then if npcID and darkmoonNPC[npcID] then
SelectGossipOption(index, "", true) SelectGossipOption(index, "", true)
StaticPopup_Hide("GOSSIP_CONFIRM") StaticPopup_Hide("GOSSIP_CONFIRM")
end end
Expand Down

0 comments on commit d431f26

Please sign in to comment.