1 QuestHelper_File
["collect_object.lua"] = "Development Version"
2 QuestHelper_Loadtime
["collect_object.lua"] = GetTime()
4 local debug_output
= false
5 if QuestHelper_File
["collect_object.lua"] == "Development Version" then debug_output
= true end
14 mine
= UNIT_SKINNABLE_ROCK
,
15 herb
= UNIT_SKINNABLE_HERB
,
16 eng
= UNIT_SKINNABLE_BOLTS
,
17 skin
= UNIT_SKINNABLE_LEATHER
,
20 local function Tooltipy(self
)
21 -- objects are a bitch since they have no unique ID or any standard way to detect them (that I know of).
22 -- So we kind of guess at it.
23 if self
:GetAnchorType() == "ANCHOR_NONE" then
24 if self
:GetItem() or self
:GetUnit() or self
:GetSpell() then return end
29 local lines
= GameTooltip
:NumLines()
30 if lines
> 2 then -- not a normal world item
32 elseif lines
== 2 then -- see if we're mine or herb
33 for k
, v
in pairs(minetypes
) do
34 if _G
["GameTooltipTextLeft2"]:GetText() == v
then
38 if not skintype
then return end -- we are neither!
39 elseif lines
== 0 then -- this isn't much of anything, is it
43 local name
= _G
["GameTooltipTextLeft1"]:GetText()
45 if string.match(name
, Patterns
.CORPSE_TOOLTIP
) then return end -- no corpses plzkthx
47 if not QHCO
[name
] then QHCO
[name
] = {} end
48 local qhci
= QHCO
[name
]
50 for k
, _
in pairs(minetypes
) do
52 qhci
[k
.. "_yes"] = (qhci
[k
.. "_yes"] or 0) + 1
54 qhci
[k
.. "_no"] = (qhci
[k
.. "_no"] or 0) + 1
58 -- We have no unique identifier, so I'm just going to record every position we see. That said, I wonder if it's a good idea to add a cooldown.
59 -- Obviously, we also have no possible range data, so, welp.
60 Merger
.Add(qhci
, GetLoc(), true)
64 function QH_Collect_Object_Init(QHCData
, API
)
65 if not QHCData
.object
then QHCData
.object
= {} end
68 API
.Registrar_TooltipHook(Tooltipy
)
70 Patterns
= API
.Patterns
71 QuestHelper
: Assert(Patterns
)
73 API
.Patterns_Register("CORPSE_TOOLTIP", "[^%s]+")
75 GetLoc
= API
.Callback_LocationBolusCurrent
76 QuestHelper
: Assert(GetLoc
)
78 Merger
= API
.Utility_Merger
79 QuestHelper
: Assert(Merger
)