From 779168ae17bc5641cb419349892a597406d50333 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Tue, 19 Aug 2014 17:07:07 +0200 Subject: [PATCH] Support the new GUID format in WoD --- QuickQuest.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/QuickQuest.lua b/QuickQuest.lua index a4063a0..77f07cb 100644 --- a/QuickQuest.lua +++ b/QuickQuest.lua @@ -101,8 +101,18 @@ local function IsGossipQuestTrivial(index) return not not select(((index * 6) - 6) + 3, GetGossipAvailableQuests()) end -local function GetCreatureID() - return tonumber(string.sub(UnitGUID('npc') or '', -12, -9), 16) +local GetCreatureID +if(WoD) then + function GetCreatureID() + local type, _, _, _, _, id = string.split(':', UnitGUID('npc') or '') + if(type == 'Creature' and id and tonumber(id)) then + return tonumber(id) + end + end +else + function GetCreatureID() + return tonumber(string.sub(UnitGUID('npc') or '', -12, -9), 16) + end end QuickQuest:Register('GOSSIP_SHOW', function() -- 1.7.9.5