965e8589c9
I implemented a QuestHelper_GetTime function for the next time Blizzard decides to fiddle with the time functions. It returns debugprofilestop() / 1000, to exactly match the precision of GetTime(). I also re-removed references to Cartographer from the rollback.
55 lignes
1,5 Kio
Lua
55 lignes
1,5 Kio
Lua
|
|
local GetTime = QuestHelper_GetTime
|
|
|
|
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
|
|
|
|
local function OnZoneChanged()
|
|
local start, cd, _ = GetItemCooldown(6948)
|
|
if last_hearth + 1800 < GetTime() and cd == 1800 then
|
|
last_hearth = start
|
|
local home = GetBindLocation()
|
|
if not QHCZ[home] then QHCZ[home] = {} end
|
|
QHCZ[home].Landing = GetLoc()
|
|
end
|
|
end
|
|
|
|
local GetMonsterType
|
|
|
|
local function OnConfirmBinder(...)
|
|
local new_home = ...
|
|
if not QHCZ[new_home] then QHCZ[new_home] = {} end
|
|
if not QHCZ[new_home].Innkeeper then QHCZ[new_home].Innkeeper = {} end
|
|
QHCZ[new_home].Innkeeper.ID = GetMonsterType(UnitGUID("target"))
|
|
end
|
|
|
|
function QH_Collect_Hearth_Init(QHCData, API)
|
|
if not QHCData.hearth then QHCData.hearth = {} end
|
|
QHCZ = QHCData.hearth
|
|
|
|
QH_Event("ZONE_CHANGED", OnZoneChanged)
|
|
QH_Event("ZONE_CHANGED_INDOORS", OnZoneChanged)
|
|
QH_Event("ZONE_CHANGED_NEW_AREA", OnZoneChanged)
|
|
QH_Event("CONFIRM_BINDER", OnConfirmBinder)
|
|
|
|
--API.Registrar_OnUpdateHook(OnUpdate)
|
|
|
|
GetLoc = API.Callback_LocationBolusCurrent
|
|
QuestHelper: Assert(GetLoc)
|
|
|
|
Merger = API.Utility_Merger
|
|
QuestHelper: Assert(Merger)
|
|
|
|
GetMonsterType = API.Utility_GetMonsterType
|
|
QuestHelper: Assert(GetMonsterType)
|
|
end
|