2011-01-28 03:12:26 +01:00
QuestHelper_File [ " collect_hearth.lua " ] = " 4.0.1.$svnversion$ "
QuestHelper_Loadtime [ " collect_hearth.lua " ] = GetTime ( )
local debug_output = false
if QuestHelper_File [ " collect_hearth.lua " ] == " Development Version " then debug_output = true end
local QHCZ
local GetLoc
local Merger
local last_hearth = 0
2011-01-29 02:22:27 +01:00
local function OnZoneChanged ( )
2011-01-28 03:12:26 +01:00
local start , cd , _ = GetItemCooldown ( 6948 )
if last_hearth + 1800 < GetTime ( ) and cd == 1800 then
last_hearth = start
2011-01-29 04:00:43 +01:00
local home = GetBindLocation ( )
if not QHCZ [ home ] then QHCZ [ home ] = { } end
QHCZ.Landing = GetLoc ( )
2011-01-28 03:12:26 +01:00
end
end
2011-01-29 03:40:17 +01:00
local GetMonsterType
2011-01-29 02:22:27 +01:00
local function OnConfirmBinder ( ... )
2011-01-29 22:42:50 +01:00
local new_home = ...
2011-01-29 03:40:17 +01:00
if not QHCZ [ new_home ] then QHCZ [ new_home ] = { } end
2011-01-29 02:22:27 +01:00
if not QHCZ [ new_home ] . Innkeeper then QHCZ [ new_home ] . Innkeeper = { } end
2011-01-29 22:45:13 +01:00
QHCZ [ new_home ] . Innkeeper.ID = GetMonsterType ( UnitGUID ( " target " ) )
2011-01-28 03:12:26 +01:00
end
2011-01-28 03:29:12 +01:00
function QH_Collect_Hearth_Init ( QHCData , API )
2011-01-28 03:12:26 +01:00
if not QHCData.hearth then QHCData.hearth = { } end
QHCZ = QHCData.hearth
2011-01-29 02:22:27 +01:00
QH_Event ( " ZONE_CHANGED " , OnZoneChanged )
QH_Event ( " ZONE_CHANGED_INDOORS " , OnZoneChanged )
QH_Event ( " ZONE_CHANGED_NEW_AREA " , OnZoneChanged )
QH_Event ( " CONFIRM_BINDER " , OnConfirmBinder )
2011-01-28 03:12:26 +01:00
--API.Registrar_OnUpdateHook(OnUpdate)
GetLoc = API.Callback_LocationBolusCurrent
QuestHelper : Assert ( GetLoc )
Merger = API.Utility_Merger
QuestHelper : Assert ( Merger )
2011-01-29 03:40:17 +01:00
GetMonsterType = API.Utility_GetMonsterType
QuestHelper : Assert ( GetMonsterType )
2011-01-28 03:12:26 +01:00
end