Skip to content

Commit 82d2ee2

Browse files
committed
Create BrewBeastMaster.lua
Beast Master PVE Leveling, Initial. Test to 50
1 parent 04470bf commit 82d2ee2

File tree

1 file changed

+280
-0
lines changed

1 file changed

+280
-0
lines changed

Diff for: Rotations/Hunter/BeastMastery/BrewBeastMaster.lua

+280
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
-------------------------------------------------------
2+
-- Author = BrewingCoder
3+
-- Patch = 10.2.6
4+
-- Coverage = 75%
5+
-- Status = Limited
6+
-- Readiness = Development
7+
-------------------------------------------------------
8+
local rotationName = "BrewBeastMaster" -- Change to name of profile listed in options drop down
9+
br.loadSupport("PetCuteOne")
10+
11+
---------------
12+
--- Toggles ---
13+
---------------
14+
local function createToggles()
15+
-- Rotation Button
16+
local RotationModes = {
17+
[1] = { mode = "On", value = 1 , overlay = "Rotation Enabled", tip = "Enables Rotation", highlight = 1, icon = br.player.spell.steadyShot},
18+
[2] = { mode = "Off", value = 2 , overlay = "Rotation Disabled", tip = "Disables Rotation", highlight = 0, icon = br.player.spell.steadyShot}
19+
};
20+
br.ui:createToggle(RotationModes,"Rotation",1,0)
21+
-- Defensive Button
22+
local DefensiveModes = {
23+
[1] = { mode = "On", value = 1 , overlay = "Defensive Enabled", tip = "Enables Defensive", highlight = 1, icon = br.player.spell.exhilaration},
24+
[2] = { mode = "Off", value = 2 , overlay = "Defensive Disabled", tip = "Disables Defensive", highlight = 0, icon = br.player.spell.exhilaration}
25+
};
26+
br.ui:createToggle(DefensiveModes,"Defensive",2,0)
27+
-- Interrupt Button
28+
local InterruptModes = {
29+
[1] = { mode = "On", value = 1 , overlay = "Interrupt Enabled", tip = "Enables Interrupt", highlight = 1, icon = br.player.spell.freezingTrap},
30+
[2] = { mode = "Off", value = 2 , overlay = "Interrupt Disabled", tip = "Disables Interrupt", highlight = 0, icon = br.player.spell.freezingTrap}
31+
};
32+
br.ui:createToggle(InterruptModes,"Interrupt",3,0)
33+
-- Pet summon
34+
local PetSummonModes = {
35+
[1] = { mode = "1", value = 1 , overlay = "Summon Pet 1", tip = "Summon Pet 1", highlight = 1, icon = br.player.spell.callPet1 },
36+
[2] = { mode = "2", value = 2 , overlay = "Summon Pet 2", tip = "Summon Pet 2", highlight = 1, icon = br.player.spell.callPet2 },
37+
[3] = { mode = "3", value = 3 , overlay = "Summon Pet 3", tip = "Summon Pet 3", highlight = 1, icon = br.player.spell.callPet3 },
38+
[4] = { mode = "4", value = 4 , overlay = "Summon Pet 4", tip = "Summon Pet 4", highlight = 1, icon = br.player.spell.callPet4 },
39+
[5] = { mode = "5", value = 5 , overlay = "Summon Pet 5", tip = "Summon Pet 5", highlight = 1, icon = br.player.spell.callPet5 },
40+
[6] = { mode = "None", value = 6 , overlay = "No pet", tip = "Dont Summon any Pet", highlight = 0, icon = br.player.spell.callPet }
41+
};
42+
br.ui:createToggle(PetSummonModes,"PetSummon",4,0)
43+
end
44+
45+
46+
---------------
47+
--- OPTIONS ---
48+
---------------
49+
local function createOptions()
50+
local optionTable
51+
52+
local function rotationOptions()
53+
local section
54+
-----------------------
55+
--- GENERAL OPTIONS --- -- Define General Options
56+
-----------------------
57+
section = br.ui:createSection(br.ui.window.profile, "General")
58+
59+
br.ui:checkSectionState(section)
60+
61+
br.rotations.support["PetCuteOne"].options()
62+
------------------------
63+
--- COOLDOWN OPTIONS --- -- Define Cooldown Options
64+
------------------------
65+
section = br.ui:createSection(br.ui.window.profile, "Cooldowns")
66+
67+
br.ui:checkSectionState(section)
68+
-------------------------
69+
--- DEFENSIVE OPTIONS --- -- Define Defensive Options
70+
-------------------------
71+
section = br.ui:createSection(br.ui.window.profile, "Defensive")
72+
73+
br.ui:checkSectionState(section)
74+
-------------------------
75+
--- INTERRUPT OPTIONS --- -- Define Interrupt Options
76+
-------------------------
77+
section = br.ui:createSection(br.ui.window.profile, "Interrupts")
78+
-- Interrupt Percentage
79+
br.ui:createSpinner(section, "Interrupt At", 0, 0, 95, 5, "|cffFFBB00Cast Percentage to use at.")
80+
br.ui:checkSectionState(section)
81+
----------------------
82+
--- TOGGLE OPTIONS --- -- Degine Toggle Options
83+
----------------------
84+
section = br.ui:createSection(br.ui.window.profile, "Toggle Keys")
85+
-- Single/Multi Toggle
86+
br.ui:createDropdown(section, "Rotation Mode", br.dropOptions.Toggle, 4)
87+
--Cooldown Key Toggle
88+
br.ui:createDropdown(section, "Cooldown Mode", br.dropOptions.Toggle, 3)
89+
--Defensive Key Toggle
90+
br.ui:createDropdown(section, "Defensive Mode", br.dropOptions.Toggle, 6)
91+
-- Interrupts Key Toggle
92+
br.ui:createDropdown(section, "Interrupt Mode", br.dropOptions.Toggle, 6)
93+
-- Pause Toggle
94+
br.ui:createDropdown(section, "Pause Mode", br.dropOptions.Toggle, 6)
95+
br.ui:checkSectionState(section)
96+
end
97+
optionTable = {{
98+
[1] = "Rotation Options",
99+
[2] = rotationOptions,
100+
}}
101+
return optionTable
102+
end
103+
104+
--------------
105+
--- Locals ---
106+
--------------
107+
-- BR API Locals - Many of these are located from System/API, this is a sample of commonly used ones but no all inclusive
108+
local buff
109+
local debuff
110+
local cast
111+
local cd
112+
local charges
113+
local enemies
114+
local module
115+
local power
116+
local talent
117+
local ui
118+
local unit
119+
local units
120+
local var
121+
122+
-- Any variables/functions made should have a local here to prevent possible conflicts with other things.
123+
124+
125+
-----------------
126+
--- Functions --- -- List all profile specific custom functions here
127+
-----------------
128+
129+
local actionList = {}
130+
actionList.Extra = function()
131+
end
132+
actionList.Defensive = function()
133+
end
134+
actionList.Interrupt = function()
135+
end
136+
actionList.Cooldown = function()
137+
end
138+
actionList.PreCombat = function()
139+
if not unit.inCombat() and not (unit.flying() or unit.mounted() or unit.taxi()) then -- Only run when not in combat and not flying/mounted/taxi
140+
if unit.valid("target") then
141+
-- Start Attack
142+
if unit.distance("target") <=40 then
143+
br._G.PetAttack("target")
144+
if not br._G.IsAutoRepeatSpell(br._G.GetSpellInfo(75)) and unit.exists("target") then
145+
br._G.StartAttack("target")
146+
end
147+
end
148+
end
149+
end
150+
end
151+
152+
----------------
153+
--- ROTATION ---
154+
----------------
155+
local function runRotation() -- This is the main profile loop, any below this point is ran every cycle, everything above is ran only once during initialization.
156+
157+
if math.random() > 0.80 then return false end;
158+
159+
if actionList.PetManagement == nil then
160+
actionList.PetManagement = br.rotations.support["PetCuteOne"].run
161+
end
162+
163+
---------------------
164+
--- Define Locals ---
165+
---------------------
166+
-- BR API Locals - These are the same as the locals above just defined for use.
167+
buff = br.player.buff
168+
debuff = br.player.debuff
169+
cast = br.player.cast
170+
cd = br.player.cd
171+
charges = br.player.charges
172+
enemies = br.player.enemies
173+
module = br.player.module
174+
power = br.player.power
175+
talent = br.player.talent
176+
ui = br.player.ui
177+
unit = br.player.unit
178+
units = br.player.units
179+
var = br.player.variables
180+
181+
units.get(5) -- Makes a variable called, units.dyn5
182+
units.get(40) -- Makes a variable called, units.dyn40
183+
enemies.get(5) -- Makes a varaible called, enemies.yards5
184+
enemies.get(40) -- Makes a varaible called, enemies.yards40
185+
enemies.get(5,"player",false,true) -- makes enemies.yards5f
186+
enemies.get(10,"player",false, true)
187+
enemies.get(20,"player",false,true)
188+
enemies.get(30,"player",false,true)
189+
enemies.get(40,"player",false,true)
190+
191+
------------------------
192+
--- Custom Variables ---
193+
------------------------
194+
-- Any other local varaible from above would also need to be defined here to be use.
195+
if var.profileStop == nil then var.profileStop = false end -- Trigger variable to help when needing to stop a profile.
196+
197+
198+
199+
--if actionList.PetManagement() then return true end
200+
---------------------
201+
--- Begin Profile ---
202+
---------------------
203+
-- Profile Stop | Pause
204+
if not unit.inCombat() and not unit.exists("target") and var.profileStop then -- Reset profile stop once stopped
205+
var.profileStop = false
206+
elseif (unit.inCombat() and var.profileStop) or ui.pause() or unit.mounted() or unit.flying() or ui.mode.rotation == 4 then -- If profile triggered to stop go here until it has.
207+
return true
208+
else
209+
if actionList.Extra() then return true end
210+
if actionList.Defensive() then return true end
211+
if actionList.PreCombat() then return true end
212+
if unit.inCombat() and unit.valid("target") and not var.profileStop then
213+
if actionList.Interrupt() then return true end
214+
215+
if unit.valid("target") and cd.global.remain() == 0 then
216+
if unit.exists(units.dyn40) and unit.distance(units.dyn40) < 40 then
217+
-----------------
218+
--- Interrupt ---
219+
-----------------
220+
if actionList.Interrupt() then return true end
221+
if not br._G.IsAutoRepeatSpell(br._G.GetSpellInfo(75)) and unit.exists(units.dyn40) and unit.distance(units.dyn40) < 40 then
222+
br._G.StartAttack(units.dyn40)
223+
end
224+
225+
if #enemies.yards40f >= 3 then
226+
if cast.able.multishot() then
227+
if cast.multishot() then ui.debug("Casting Multi-Shot") return true end
228+
else
229+
if cast.able.disengage() then
230+
if cast.disengage() then ui.debug("Casting Disengage") return true end
231+
end
232+
end
233+
end
234+
235+
if cast.able.bestialWrath() and unit.ttd("target") >= 20 then
236+
if cast.bestialWrath() then ui.debug("Casting Bestial Wrath") return true end
237+
end
238+
239+
if cast.able.huntersMark() and not debuff.huntersMark.exists(units.dyn40) then
240+
if cast.huntersMark() then ui.debug("Cast Hunter's Mark") return true end
241+
end
242+
243+
if unit.hp("target") <= 20 and cast.able.killShot() then
244+
if cast.killShot() then ui.debug("Casting Kill Shot") return true end
245+
end
246+
247+
if cast.able.killCommand("target") then
248+
if cast.killCommand("target") then ui.debug("Casting Kill Command") return true end
249+
end
250+
251+
if not buff.barbedShot.exists() or charges.barbedShot.frac() > 1.0 then
252+
if cast.able.barbedShot() then
253+
if cast.barbedShot() then ui.debug("Casting Barbed Shot") return true end
254+
end
255+
end
256+
257+
if cast.able.arcaneShot() then
258+
if cast.arcaneShot() then ui.debug("Casting Arcane Shot") return true end
259+
end
260+
261+
if cast.able.cobraShot("target") then
262+
if cast.cobraShot() then ui.debug("Casting Cobra Shot") return true end
263+
elseif cast.able.steadyShot() then
264+
if cast.steadyShot() then ui.debug("Casting Steady Shot") return true end
265+
end
266+
267+
end -- End In Combat Rotation
268+
end
269+
end -- End In Combat Rotation
270+
end -- Pause
271+
end -- End runRotation
272+
local id = 253 -- Change to the spec id profile is for. Spec ID can be found at: https://wowpedia.fandom.com/wiki/SpecializationID
273+
-- DO NOT EDIT ANYTHING BELOW THIS LINE, WILL BREAK PROFILE --
274+
if br.rotations[id] == nil then br.rotations[id] = {} end
275+
tinsert(br.rotations[id],{
276+
name = rotationName,
277+
toggles = createToggles,
278+
options = createOptions,
279+
run = runRotation,
280+
})

0 commit comments

Comments
 (0)