1 QuestHelper_File
["filter_base.lua"] = "Development Version"
2 QuestHelper_Loadtime
["filter_base.lua"] = GetTime()
4 local avg_level
= UnitLevel("player")
7 function QH_Filter_Group_Sync()
8 avg_level
= UnitLevel("player")
10 if GetNumRaidMembers() > 0 then
15 local liv
= UnitLevel(string.format("raid%d", i
))
17 avg_level
= avg_level
+ liv
21 elseif GetNumPartyMembers() > 0 then
24 local liv
= UnitLevel(string.format("party%d", i
))
26 avg_level
= avg_level
+ liv
32 if count
== 0 then -- welp
33 QuestHelper
:TextOut("This should never, ever happen. Please tell Zorba about it!")
34 QuestHelper
: Assert(false)
35 avg_level
= UnitLevel("player")
39 avg_level
= avg_level
/ count
47 5 +2 (+2 if dungeonflagged)
48 +6 and on: +15 (total of +25, the goal here is that, with default settings, lv60 raids shouldn't show up at lv80)
51 local function VirtualLevel(avg_level
, count
, dungeonflag
)
52 QuestHelper
: Assert(avg_level
)
53 if dungeonflag
== nil and count
== 5 then dungeonflag
= true end -- "nil" is kind of "default"
54 if count
> 5 then dungeonflag
= true end
56 if count
<= 5 then avg_level
= avg_level
+ 2 * count
- 2 end
57 if count
>= 5 and dungeonflag
then avg_level
= avg_level
+ 2 end
58 if count
> 5 then avg_level
= avg_level
+ 15 end
63 local filter_quest_level
= QH_MakeFilter("filter_quest_level", function(obj
)
64 if not QuestHelper_Pref
.filter_level
then return end
66 if not obj
.type_quest
then return end -- yeah it's fine
68 if obj
.type_quest
.objectives
> 0 then return end
71 if obj
.type_quest
.variety
== GROUP
then
72 if obj
.type_quest
.groupsize
> 0 then
73 qtx
= VirtualLevel(obj
.type_quest
.level
, obj
.type_quest
.groupsize
, false)
75 qtx
= VirtualLevel(obj
.type_quest
.level
, 5, false) -- meh
77 elseif obj
.type_quest
.variety
== LFG_TYPE_DUNGEON
or obj
.type_quest
.variety
== DUNGEON_DIFFICULTY2
then
78 qtx
= VirtualLevel(obj
.type_quest
.level
, 5, true)
79 elseif obj
.type_quest
.variety
== LFG_TYPE_RAID
then
80 qtx
= VirtualLevel(obj
.type_quest
.level
, 25, true)
82 qtx
= VirtualLevel(obj
.type_quest
.level
, 1, false)
85 if qtx
> VirtualLevel(avg_level
, count
) + QuestHelper_Pref
.level
then return true end -- bzzt
86 end, {friendly_reason
= QHText("FILTERED_LEVEL"), friendly_name
= "level"})
88 local filter_quest_done
= QH_MakeFilter("filter_quest_done", function(obj
)
89 if not QuestHelper_Pref
.filter_done
then return end
91 if not obj
.type_quest
then return end -- yeah it's fine
92 if not obj
.type_quest
.done
then return true end -- bzzt
93 end, {friendly_reason
= QHText("FILTERED_COMPLETE"), friendly_name
= "done"})
95 local filter_quest_watched
= QH_MakeFilter("filter_quest_watched", function(obj
)
96 if not QuestHelper_Pref
.filter_watched
then return end
98 if not obj
.type_quest
then return end
100 return not IsQuestWatched(obj
.type_quest
.index
)
101 end, {friendly_reason
= QHText("FILTERED_UNWATCHED"), friendly_name
= "watched"})
103 -- Delay because of beql which is a bitch.
104 QH_AddNotifier(GetTime() + 5, function ()
105 local aqw_orig
= AddQuestWatch
-- yoink
106 AddQuestWatch
= function(...)
107 QH_Route_Filter_Rescan("filter_quest_watched")
110 local rqw_orig
= RemoveQuestWatch
-- yoink
111 RemoveQuestWatch
= function(...)
112 QH_Route_Filter_Rescan("filter_quest_watched")
118 local filter_zone
= QH_MakeFilter("filter_zone", function(obj
)
119 if not QuestHelper_Pref
.filter_zone
then return end
121 return obj
.loc
.p
~= QuestHelper
.i
122 end, {friendly_reason
= QHText("FILTERED_ZONE"), friendly_name
= "zone"})
124 local filter_blocked
= QH_MakeFilter("filter_blocked", function(obj
, blocked
)
125 if not QuestHelper_Pref
.filter_blocked
then return end
128 end, {friendly_reason
= QHText("FILTERED_BLOCKED"), friendly_name
= "blocked"})
130 QH_Route_RegisterFilter(filter_quest_level
, "filter_quest_level")
131 QH_Route_RegisterFilter(filter_quest_done
, "filter_quest_done")
132 QH_Route_RegisterFilter(filter_quest_watched
, "filter_quest_watched")
133 QH_Route_RegisterFilter(filter_zone
, "filter_zone")
134 QH_Route_RegisterFilter(filter_blocked
, "filter_blocked")
139 function QH_WACKYLAND_ENABLE()
141 local filter_wackyland
= QH_MakeFilter("filter_wackyland", function(obj
)
142 return math
.random() < 0.5
143 end, {friendly_reason
= "wacky", friendly_name
= "wacky"})
144 QH_Route_RegisterFilter(filter_wackyland
, "filter_wackyland")