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
== DUNGEON_DIFFICULTY2
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 if obj
.loc
.p
== 74 and obj
.type_quest
.variety
== PVP
then return true end
123 end, {friendly_reason
= QHText("FILTERED_WINTERGRASP"), friendly_name
= "wintergrasp"})
125 local filter_quest_done
= QH_MakeFilter("filter_quest_done", function(obj
)
126 if not QuestHelper_Pref
.filter_done
then return end
128 if not obj
.type_quest
then return end -- yeah it's fine
129 if not obj
.type_quest
.done
then return true end -- bzzt
130 end, {friendly_reason
= QHText("FILTERED_COMPLETE"), friendly_name
= "done"})
132 local filter_quest_watched
= QH_MakeFilter("filter_quest_watched", function(obj
)
133 if not QuestHelper_Pref
.filter_watched
then return end
135 if not obj
.type_quest
or not obj
.type_quest
.index
then return end
137 return not IsQuestWatched(obj
.type_quest
.index
)
138 end, {friendly_reason
= QHText("FILTERED_UNWATCHED"), friendly_name
= "watched"})
140 -- Delay because of beql which is a bitch.
141 QH_AddNotifier(GetTime() + 5, function ()
142 local aqw_orig
= AddQuestWatch
-- yoink
143 AddQuestWatch
= function(...)
144 QH_Route_Filter_Rescan("filter_quest_watched")
147 local rqw_orig
= RemoveQuestWatch
-- yoink
148 RemoveQuestWatch
= function(...)
149 QH_Route_Filter_Rescan("filter_quest_watched")
155 local filter_zone
= QH_MakeFilter("filter_zone", function(obj
)
156 if not QuestHelper_Pref
.filter_zone
then return end
158 return obj
.loc
.p
~= QuestHelper
.i
159 end, {friendly_reason
= QHText("FILTERED_ZONE"), friendly_name
= "zone"})
161 local filter_blocked
= QH_MakeFilter("filter_blocked", function(obj
, blocked
)
162 if not QuestHelper_Pref
.filter_blocked
then return end
165 end, {friendly_reason
= QHText("FILTERED_BLOCKED"), friendly_name
= "blocked"})
167 QH_Route_RegisterFilter(filter_quest_level
, "filter_quest_level")
168 QH_Route_RegisterFilter(filter_quest_done
, "filter_quest_done")
169 QH_Route_RegisterFilter(filter_quest_watched
, "filter_quest_watched")
170 QH_Route_RegisterFilter(filter_quest_group
, "filter_quest_group")
171 QH_Route_RegisterFilter(filter_quest_wintergrasp
, "filter_quest_wintergrasp")
172 QH_Route_RegisterFilter(filter_zone
, "filter_zone")
173 QH_Route_RegisterFilter(filter_blocked
, "filter_blocked")
178 function QH_WACKYLAND_ENABLE()
180 local filter_wackyland
= QH_MakeFilter("filter_wackyland", function(obj
)
181 return math
.random() < 0.5
182 end, {friendly_reason
= "wacky", friendly_name
= "wacky"})
183 QH_Route_RegisterFilter(filter_wackyland
, "filter_wackyland")