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")
11 if not QuestHelper_Pref
.solo
then
12 if GetNumRaidMembers() > 0 then
17 local liv
= UnitLevel(string.format("raid%d", i
))
19 avg_level
= avg_level
+ liv
23 elseif GetNumPartyMembers() > 0 then
26 local liv
= UnitLevel(string.format("party%d", i
))
28 avg_level
= avg_level
+ liv
35 if count
== 0 then -- welp
36 QuestHelper
:TextOut("This should never, ever happen. Please tell Zorba about it!")
37 QuestHelper
: Assert(false)
38 avg_level
= UnitLevel("player")
42 avg_level
= avg_level
/ count
50 5 +2 (+2 if dungeonflagged)
51 +6 and on: +15 (total of +25, the goal here is that, with default settings, lv60 raids shouldn't show up at lv80)
54 local function VirtualLevel(avg_level
, count
, dungeonflag
)
55 QuestHelper
: Assert(avg_level
)
56 if dungeonflag
== nil and count
== 5 then dungeonflag
= true end -- "nil" is kind of "default"
57 if count
> 5 then dungeonflag
= true end
59 if count
<= 5 then avg_level
= avg_level
+ 2 * count
- 2 end
60 if count
>= 5 and dungeonflag
then avg_level
= avg_level
+ 2 end
61 if count
> 5 then avg_level
= avg_level
+ 15 end
66 local filter_quest_level
= QH_MakeFilter("filter_quest_level", function(obj
)
67 if not QuestHelper_Pref
.filter_level
then return end
69 if not obj
.type_quest
then return end -- yeah it's fine
71 if obj
.type_quest
.objectives
> 0 and obj
.cluster
.type_quest_finish
then return end
74 if obj
.type_quest
.variety
== GROUP
then
75 if obj
.type_quest
.groupsize
> 0 then
76 qtx
= VirtualLevel(obj
.type_quest
.level
, obj
.type_quest
.groupsize
, false)
78 qtx
= VirtualLevel(obj
.type_quest
.level
, 5, false) -- meh
80 elseif obj
.type_quest
.variety
== LFG_TYPE_DUNGEON
or obj
.type_quest
.variety
== DUNGEON_DIFFICULTY2
then
81 qtx
= VirtualLevel(obj
.type_quest
.level
, 5, true)
82 elseif obj
.type_quest
.variety
== LFG_TYPE_RAID
then
83 qtx
= VirtualLevel(obj
.type_quest
.level
, 25, true)
85 qtx
= VirtualLevel(obj
.type_quest
.level
, 1, false)
88 if qtx
> VirtualLevel(avg_level
, count
) + QuestHelper_Pref
.level
then return true end -- bzzt
89 end, {friendly_reason
= QHText("FILTERED_LEVEL"), friendly_name
= "level"})
91 local filter_quest_group
= QH_MakeFilter("filter_quest_group", function(obj
)
92 if not QuestHelper_Pref
.filter_group
then return end
94 if not obj
.type_quest
then return end -- yeah it's fine
95 if obj
.type_quest
.objectives
> 0 and obj
.cluster
.type_quest_finish
then return end
96 if count
> 1 and not QuestHelper_Pref
.solo
then return end
98 local expected_players
= 1
99 if obj
.type_quest
.variety
== GROUP
then
100 if obj
.type_quest
.groupsize
> 0 then
101 expected_players
= obj
.type_quest
.groupsize
105 elseif obj
.type_quest
.variety
== LFG_TYPE_DUNGEON
or obj
.type_quest
.variety
== ITEM_HEROIC
then
107 elseif obj
.type_quest
.variety
== LFG_TYPE_RAID
then
108 expected_players
= 10
111 if expected_players
> QuestHelper_Pref
.filter_group_param
then return true end
112 end, {friendly_reason
= QHText("FILTERED_GROUP"), friendly_name
= "group"})
114 local filter_quest_wintergrasp
= QH_MakeFilter("filter_quest_wintergrasp", function(obj
)
115 if not QuestHelper_Pref
.filter_wintergrasp
then return end
117 if not obj
.type_quest
then return end
118 if obj
.type_quest
.objectives
> 0 and obj
.cluster
.type_quest_finish
then return end
120 if QuestHelper
.collect_rc
and QuestHelper
.collect_rz
and QuestHelper_IndexLookup
[QuestHelper
.collect_rc
] and QuestHelper_IndexLookup
[QuestHelper
.collect_rc
][QuestHelper
.collect_rz
] == 74 then return end
122 --print(obj.loc.p, obj.type_quest.variety, PVP, obj.type_quest.variety == PVP, obj.loc.p == 74 and obj.type_quest.variety == PVP)
124 if obj
.loc
.p
== 74 and obj
.type_quest
.variety
== PVP
then return true end
125 end, {friendly_reason
= QHText("FILTERED_WINTERGRASP"), friendly_name
= "wintergrasp"})
127 local filter_quest_done
= QH_MakeFilter("filter_quest_done", function(obj
)
128 if not QuestHelper_Pref
.filter_done
then return end
130 if not obj
.type_quest
then return end -- yeah it's fine
131 if not obj
.type_quest
.done
then return true end -- bzzt
132 end, {friendly_reason
= QHText("FILTERED_COMPLETE"), friendly_name
= "done"})
134 local filter_quest_watched
= QH_MakeFilter("filter_quest_watched", function(obj
)
135 if not QuestHelper_Pref
.filter_watched
then return end
137 if not obj
.type_quest
or not obj
.type_quest
.index
then return end
139 return not IsQuestWatched(obj
.type_quest
.index
)
140 end, {friendly_reason
= QHText("FILTERED_UNWATCHED"), friendly_name
= "watched"})
142 -- Delay because of beql which is a bitch.
143 QH_AddNotifier(GetTime() + 5, function ()
144 local aqw_orig
= AddQuestWatch
-- yoink
145 AddQuestWatch
= function(...)
146 QH_Route_Filter_Rescan("filter_quest_watched")
149 local rqw_orig
= RemoveQuestWatch
-- yoink
150 RemoveQuestWatch
= function(...)
151 QH_Route_Filter_Rescan("filter_quest_watched")
157 local filter_zone
= QH_MakeFilter("filter_zone", function(obj
)
158 if not QuestHelper_Pref
.filter_zone
then return end
160 return obj
.loc
.p
~= QuestHelper
.i
161 end, {friendly_reason
= QHText("FILTERED_ZONE"), friendly_name
= "zone"})
163 local filter_blocked
= QH_MakeFilter("filter_blocked", function(obj
, blocked
)
164 if not QuestHelper_Pref
.filter_blocked
then return end
167 end, {friendly_reason
= QHText("FILTERED_BLOCKED"), friendly_name
= "blocked"})
169 QH_Route_RegisterFilter(filter_quest_level
, "filter_quest_level")
170 QH_Route_RegisterFilter(filter_quest_done
, "filter_quest_done")
171 QH_Route_RegisterFilter(filter_quest_watched
, "filter_quest_watched")
172 QH_Route_RegisterFilter(filter_quest_group
, "filter_quest_group")
173 QH_Route_RegisterFilter(filter_quest_wintergrasp
, "filter_quest_wintergrasp")
174 QH_Route_RegisterFilter(filter_zone
, "filter_zone")
175 QH_Route_RegisterFilter(filter_blocked
, "filter_blocked")
180 function qh_hackery_wackyland_enable()
182 local filter_wackyland
= QH_MakeFilter("filter_wackyland", function(obj
)
183 return math
.random() < 0.5
184 end, {friendly_reason
= "wacky", friendly_name
= "wacky"})
185 QH_Route_RegisterFilter(filter_wackyland
, "filter_wackyland")