Skip to content

Commit

Permalink
Merge pull request #188 from yannlugrin/feature/wrath_druid
Browse files Browse the repository at this point in the history
Use Druid's Wrath form spells on WotLK
  • Loading branch information
DanSheps committed Nov 26, 2022
2 parents 951386c + bc0734a commit b319faa
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Versions/Common/BeStride_Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BeStride_Constants = {
},
spells = {
druid = {
catform = 783,
catform = 768,
aquaticform = 783,
travelform = 783,
flightform = 783,
Expand Down
29 changes: 12 additions & 17 deletions Versions/Common/BeStride_Mount.lua
Original file line number Diff line number Diff line change
Expand Up @@ -218,29 +218,24 @@ function BeStride_Mount:DemonHunterGlide()
return self:MountSpell(SpellToName(131347))
end

function BeStride_Mount:Druid()
local travelForm, flightForm = 783, 783 -- 3 in 1 travel form

if GetUnitSpeed("player") ~= 0 then
return self:MountSpell(SpellToName(783))
elseif BeStride:DruidFlyingMTFF() or IsFalling() or IsFlying() or GetShapeshiftForm() == 3 then
return self:MountSpell(SpellToName(783))
elseif IsFlying() then
return self:Flying(name)
else
return self:Regular(name)
end
function BeStride_Mount:DruidCatForm()
return self:MountSpell(SpellToName(BeStride_Constants.spells.druid.catform))
end

function BeStride_Mount:DruidFlying()
return self:Druid()
function BeStride_Mount:DruidTravelForm()
return self:MountSpell(SpellToName(BeStride_Constants.spells.druid.travelform))
end

function BeStride_Mount:DruidAquaticForm()
return self:MountSpell(SpellToName(BeStride_Constants.spells.druid.aquaticform))
end

function BeStride_Mount:DruidTravel()
return self:MountSpell(SpellToName(783))
function BeStride_Mount:DruidFlightForm()
return self:MountSpell(SpellToName(BeStride_Constants.spells.druid.flightform))
end

function BeStride_Mount:DruidNoForm()
return "/cancelform"
end

function BeStride_Mount:HunterAspectOfTheCheetah()
Expand Down Expand Up @@ -313,4 +308,4 @@ end

function BeStride_Mount:RogueSprint()
return self:MountSpell("[@player] "..SpellToName(2983))
end
end
24 changes: 14 additions & 10 deletions Versions/Common/logic.class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ end
-- Check for Swim Form
-- Returns: boolean
function BeStride:DruidCanSwim()
if IsUsableSpell(783) then
if IsUsableSpell(BeStride_Constants.spells.druid.aquaticform) then
return true
else
return false
Expand All @@ -290,7 +290,7 @@ end
-- Check for Travel Form
-- Returns: boolean
function BeStride:DruidCanTravel()
if IsUsableSpell(783) then
if IsUsableSpell(BeStride_Constants.spells.druid.travelform) then
return true
else
return false
Expand All @@ -300,7 +300,7 @@ end
-- Check for Travel Form
-- Returns: boolean
function BeStride:DruidCanCat()
if IsSpellKnown(768) and IsUsableSpell(768) then
if IsSpellKnown(BeStride_Constants.spells.druid.catform) and IsUsableSpell(BeStride_Constants.spells.druid.catform) then
return true
else
return false
Expand All @@ -310,7 +310,7 @@ end
-- Check for Flight Form
-- Returns: boolean
function BeStride:DruidCanFly()
if IsUsableSpell(783) then
if IsPlayerSpell(BeStride_Constants.spells.druid.flightform) then
return true
else
return false
Expand Down Expand Up @@ -535,12 +535,16 @@ end
-- ----- --

function BeStride:IsDruidTraveling()
if self:IsDruid() then
local index = GetShapeshiftForm()
if index == 3 then
return true
end
end
if self:IsDruid() then
local index = GetShapeshiftFormID()
if index == 3 or index == 4 or index == 29 or index == 27 then
return true
else
return false
end
else
return false
end
end

function BeStride:DruidFlying()
Expand Down
2 changes: 1 addition & 1 deletion Versions/Common/mount.lua
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function BeStride:Combat()
elseif self:IsDemonHunter() and self:DemonHunterFelRush() then
return BeStride_Mount:DemonHunterFelRush()
elseif self:IsDruid() and BeStride:DBGet("settings.classes.druid.traveltotravel") then
return BeStride_Mount:DruidTravel()
return BeStride_Mount:DruidTravelForm()
elseif self:IsHunterAndSpecial() then
return self:Hunter()
elseif self:IsMage() and (BeStride:DBGet("settings.classes.mage.blink") or BeStride:DBGet("settings.classes.mage.slowfall")) then
Expand Down
32 changes: 21 additions & 11 deletions Versions/Common/mounting.class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,29 @@ end

function BeStride:Druid()
if IsOutdoors() ~= true and self:DruidCanCat() then
return BeStride_Mount:MountSpell(SpellToName(768))
return BeStride_Mount:DruidCatForm()
elseif IsFalling() then
if self:IsFlyable() and self:DruidCanFly() then
return BeStride_Mount:DruidFlightForm()
elseif self:DruidCanCat() then
return BeStride_Mount:DruidCatForm() -- limit fall damage
end
elseif GetShapeshiftFormID() == 3 then
if self:IsFlyable() and self:DruidCanFly() and self:DruidFlightFormPriority() then
return BeStride_Mount:DruidFlightForm() -- assume we always prefer the fly form
else
return BeStride_Mount:DruidNoForm()
end
elseif self:IsDruidTraveling() then
return BeStride_Mount:DruidNoForm() -- dismount like logic for druids
elseif IsSwimming() and self:DruidCanSwim() and BeStride:DBGet("settings.mount.noswimming") == false then
return BeStride_Mount:MountSpell(SpellToName(783))
elseif self:MovementCheck() and IsOutdoors() then
return BeStride_Mount:MountSpell(SpellToName(783))
elseif GetShapeshiftForm() == 3 then
return BeStride_Mount:MountSpell(SpellToName(783))
return BeStride_Mount:DruidAquaticForm()
elseif IsMounted() and IsFlying() and self:IsFlyable() and self:DruidCanFly() and self:DruidFlyingMTFF() then
return BeStride_Mount:MountSpell(SpellToName(783))
return BeStride_Mount:DruidFlightForm()
elseif self:IsFlyable() and self:DruidCanFly() and self:DruidFlightFormPriority() then
return BeStride_Mount:MountSpell(SpellToName(783))
elseif IsFalling() and self:DruidCanFly() then
return BeStride_Mount:MountSpell(SpellToName(783))
return BeStride_Mount:DruidFlightForm()
elseif self:MovementCheck() and IsOutdoors() then
return BeStride_Mount:DruidTravelForm()
else
BeStride_Debug:Error("This is a error. Please report to the maintainer at https://www.github.com/dansheps/bestride/issues/. ID: DRBSL")
end
Expand Down Expand Up @@ -120,4 +130,4 @@ function BeStride:Rogue()
else
BeStride_Debug:Error("This is a error. Please report to the maintainer at https://www.github.com/dansheps/bestride/issues/. ID: RGBSL")
end
end
end
3 changes: 0 additions & 3 deletions Versions/Wrath/bestride.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@

function BeStride:Version_OnEnable()
BeStride_Constants.spells.druid.travelform = 783
BeStride_Constants.spells.druid.flightform = 33943
if IsPlayerSpell(40120) then
BeStride_Constants.spells.druid.flightform = 40120
else
BeStride_Constants.spells.druid.flightform = 33943
end
BeStride_Constants.spells.druid.aquaticform = 1066
end
Expand Down

0 comments on commit b319faa

Please sign in to comment.