-
Notifications
You must be signed in to change notification settings - Fork 16
/
mount.lua
320 lines (313 loc) · 9.9 KB
/
mount.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
function BeStride:Regular()
if self:CanUseTargetsMount() then
self:DismountAndExit()
return self:UseTargetsMount()
-- Aspect of the Cheetah is available from level 5
elseif self:IsHunterAndSpecial() then
return self:Hunter()
-- Check if we are mounted
elseif IsMounted() and self:NeedsChauffeur() then
self:DismountAndExit()
return BeStride_Mount:Chauffeur()
elseif self:NeedsChauffeur() then
self:DismountAndExit()
return BeStride_Mount:Chauffeur()
elseif self:IsHerbalismAndCanRobot() then
self:DismountAndExit()
return BeStride_Mount:Robot()
elseif self:IsDeathKnightAndSpecial() then
self:DismountAndExit()
return self:DeathKnight()
elseif self:IsDemonHunterAndSpecial() then
self:DismountAndExit()
return self:DemonHunter()
elseif self:IsDruidAndSpecial() then
self:DismountAndExit()
return self:Druid()
elseif self:IsMageAndSpecial() then
self:DismountAndExit()
return self:Mage()
elseif self:IsMonkAndSpecial() then
self:DismountAndExit()
return self:Monk()
elseif self:IsPaladinAndSpecial() then
self:DismountAndExit()
return self:Paladin()
elseif self:IsPriestAndSpecial() then
self:DismountAndExit()
return self:Priest()
elseif self:IsShamanAndSpecial() then
self:DismountAndExit()
return self:Shaman()
elseif self:IsEvokerAndSpecial() then
self:DismountAndExit()
return self:Evoker()
elseif self:IsRogueAndSpecial() then
self:DismountAndExit()
return self:Rogue()
elseif self:IsLoanedMount() then
self:DismountAndExit()
return BeStride_Mount:Loaned()
elseif self:CanBroom() then
self:DismountAndExit()
return BeStride_Mount:Broom()
elseif self:IsSpecialZone() then
self:DismountAndExit()
return BeStride_Mount:SpecialZone()
elseif self:IsRepairable() then
self:DismountAndExit()
return BeStride_Mount:Repair()
elseif IsMounted() then
if IsFlying() then
if self:IsFlyable() and BeStride:DBGet("settings.mount.nodismountwhileflying") ~= true then
self:DismountAndExit()
if BeStride:DBGet("settings.mount.remount") then
return BeStride_Mount:Flying()
else
return nil
end
else
return nil
end
elseif IsSwimming() and BeStride:DBGet("settings.mount.noswimming") == false then
self:DismountAndExit()
return BeStride_Mount:Swimming()
elseif self:IsFlyable() and IsInGroup() == true and BeStride:DBGet("settings.mount.prioritizepassenger") == true then
self:DismountAndExit()
if BeStride:DBGet("settings.mount.remount") then
return BeStride_Mount:Passenger("flying")
else
return nil
end
elseif self:IsFlyable() then
self:DismountAndExit()
if BeStride:DBGet("settings.mount.remount") then
return BeStride_Mount:Flying()
else
return nil
end
elseif IsOutdoors() and IsInGroup() == true and BeStride:DBGet("settings.mount.prioritizepassenger") == true then
self:DismountAndExit()
if BeStride:DBGet("settings.mount.remount") then
return BeStride_Mount:Passenger("ground")
else
return nil
end
else
self:DismountAndExit()
if BeStride:DBGet("settings.mount.remount") then
return BeStride_Mount:Regular()
else
return nil
end
end
elseif IsSwimming() and IsOutdoors() and BeStride:DBGet("settings.mount.noswimming") == false then
self:DismountAndExit()
return BeStride_Mount:Swimming()
elseif CanExitVehicle() then
self:DismountAndExit()
return BeStride_Mount:Regular()
elseif self:IsDragonRidingZone() then
return BeStride_Mount:Dragonriding()
elseif self:IsFlyable() and IsOutdoors() and IsInGroup() == true and BeStride:DBGet("settings.mount.prioritizepassenger") == true and #mountTable["passenger"] > 0 then
return BeStride_Mount:Passenger("flying")
elseif self:IsFlyable() then
return BeStride_Mount:Flying()
elseif IsOutdoors() and IsInGroup() == true and BeStride:DBGet("settings.mount.prioritizepassenger") == true and #mountTable["passenger"] > 0 then
return BeStride_Mount:Passenger("ground")
elseif self:IsMountable() then
return BeStride_Mount:Regular()
elseif IsOutdoors() then
return BeStride_Mount:Ground()
else
return nil
end
end
function BeStride:GroundMountButton()
-- Aspect of the Cheetah is available from level 5
if self:IsHunterAndSpecial() then
return self:Hunter()
-- Check if we are mounted
elseif IsMounted() and self:NeedsChauffeur() then
self:DismountAndExit()
return BeStride_Mount:Chauffeur()
elseif self:NeedsChauffeur() then
self:DismountAndExit()
return BeStride_Mount:Chauffeur()
elseif self:IsHerbalismAndCanRobot() then
self:DismountAndExit()
return BeStride_Mount:Robot()
elseif self:IsDeathKnightAndSpecial() then
self:DismountAndExit()
return self:DeathKnight()
elseif self:IsDemonHunterAndSpecial() then
self:DismountAndExit()
return self:DemonHunter()
elseif self:IsDruidAndSpecial() then
self:DismountAndExit()
return self:Druid()
elseif self:IsMageAndSpecial() then
self:DismountAndExit()
return self:Mage()
elseif self:IsMonkAndSpecial() then
self:DismountAndExit()
return self:Monk()
elseif self:IsPaladinAndSpecial() then
self:DismountAndExit()
return self:Paladin()
elseif self:IsShamanAndSpecial() then
self:DismountAndExit()
return self:Shaman()
elseif self:IsRogueAndSpecial() then
self:DismountAndExit()
return self:Rogue()
elseif self:CanBroom() then
self:DismountAndExit()
return BeStride_Mount:Broom()
elseif self:IsLoanedMount() then
self:DismountAndExit()
return BeStride_Mount:Loaned()
elseif self:IsSpecialZone() then
self:DismountAndExit()
return BeStride_Mount:SpecialZone()
elseif self:IsRepairable() then
self:DismountAndExit()
return BeStride_Mount:Repair()
elseif IsMounted() then
if IsFlying() and self:IsFlyable() and BeStride:DBGet("settings.mount.nodismountwhileflying") == true then
return nil
elseif IsOutdoors() and IsInGroup() == true and BeStride:DBGet("settings.mount.prioritizepassenger") == true then
self:DismountAndExit()
if BeStride:DBGet("settings.mount.remount") then
return BeStride_Mount:Passenger("ground")
else
return nil
end
elseif IsSwimming() and BeStride:DBGet("settings.mount.noswimming") == false then
self:DismountAndExit()
return BeStride_Mount:Swimming()
else
return BeStride_Mount:Ground()
end
elseif IsOutdoors() and IsInGroup() == true and BeStride:DBGet("settings.mount.prioritizepassenger") == true then
return BeStride_Mount:Passenger("ground")
elseif IsSwimming() and IsOutdoors() and BeStride:DBGet("settings.mount.noswimming") == false then
self:DismountAndExit()
return BeStride_Mount:Swimming()
elseif IsOutdoors() then
return BeStride_Mount:Ground()
else
return nil
end
end
function BeStride:RepairMountButton()
if IsMounted() or IsOutdoors() then
if IsFlying() and self:IsFlyable() and BeStride:DBGet("settings.mount.nodismountwhileflying") == true then
return nil
else
self:DismountAndExit()
return BeStride_Mount:Repair()
end
else
return nil
end
end
function BeStride:PassengerMountButton(type)
if IsMounted() or IsOutdoors() then
if IsFlying() and self:IsFlyable() and BeStride:DBGet("settings.mount.nodismountwhileflying") == true then
return nil
else
self:DismountAndExit()
return BeStride_Mount:Passenger(type)
end
else
return nil
end
end
function BeStride:Combat()
if IsMounted() then
action = BeStride_Mount:Dismount() .. "\n"
else
action = ""
end
if self:IsDeathKnight() and BeStride:DBGet("settings.classes.deathknight.wraithwalk") and BeStride:CanWraithWalk() then
special = BeStride_Mount:DeathKnightWraithWalk()
if special ~= nil then
action = action .. special
end
elseif self:IsDemonHunter() and self:DemonHunterFelRush() then
special = BeStride_Mount:DemonHunterFelRush()
if special ~= nil then
action = action .. special
end
elseif self:IsDruid() and BeStride:DBGet("settings.classes.druid.traveltotravel") then
special = BeStride_Mount:DruidTravelForm()
if special ~= nil then
action = action .. special
end
elseif self:IsHunterAndSpecial() then
action = action .. self:Hunter()
if special ~= nil then
action = action .. special
end
elseif self:IsMage() and (BeStride:DBGet("settings.classes.mage.blink") or BeStride:DBGet("settings.classes.mage.slowfall")) then
if self:MageBlink() and BeStride:DBGet("settings.classes.mage.blinkpriority") then
special = BeStride_Mount:MageBlink()
if special ~= nil then
action = action .. special
end
else
special = BeStride_Mount:MageSlowFall()
if special ~= nil then
action = action .. special
end
end
elseif self:IsMonk() and BeStride:DBGet("settings.classes.monk.roll") then
special = BeStride_Mount:MonkRoll()
if special ~= nil then
action = action .. special
end
elseif self:IsPaladin() and BeStride:DBGet("settings.classes.paladin.steed") then
special = BeStride_Mount:PaladinDivineSteed()
if special ~= nil then
action = action .. special
end
elseif self:IsPriest() and BeStride:DBGet("settings.classes.priest.levitate") then
special = BeStride_Mount:PriestLevitate()
if special ~= nil then
action = action .. special
end
elseif self:IsRogue() and BeStride:DBGet("settings.classes.rogue.sprint") then
special = BeStride_Mount:RogueSprint()
if special ~= nil then
action = action .. special
end
elseif self:IsShaman() and BeStride:DBGet("settings.classes.shaman.ghostwolf") then
special = BeStride_Mount:ShamanGhostWolf()
if special ~= nil then
action = action .. special
end
elseif self:IsEvoker() and BeStride:DBGet("settings.classes.evoker.hover") then
special = BeStride_Mount:EvokerHover()
if special ~= nil then
action = action .. special
end
elseif self:IsSpecialZone() then
special = BeStride_Mount:SpecialZone()
if special ~= nil then
action = action .. special
end
end
return action
end
function BeStride:DismountAndExit()
if CanExitVehicle() then
VehicleExit()
elseif IsMounted() then
Dismount()
end
end
function BeStride:UseTargetsMount()
local spellId = self:GetKnownMountFromTarget()
return BeStride_Mount:MountSpell(GetSpellInfo(spellId))
end