Skip to content

Commit

Permalink
Updated Druid scripts to handle classic and retail
Browse files Browse the repository at this point in the history
  • Loading branch information
GovtGeek committed Apr 1, 2024
1 parent fe9eb19 commit 34a5208
Showing 1 changed file with 36 additions and 23 deletions.
59 changes: 36 additions & 23 deletions OutfitterScripting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,14 @@ function Outfitter:GenerateSmartUnequipScript(pEventID, pDescription, pUnequipDe
-- $SETTING Tree4={type="boolean", label=Outfitter:GetTalentTreeName(4), default=true}
-- Unequip and return if they're not in an enabled spec
if not setting.Tree1 and GetSpecialization() == 1
or not setting.Tree2 and GetSpecialization() == 2
or not setting.Tree3 and GetSpecialization() == 3
or not setting.Tree4 and GetSpecialization() == 4 then
equip = false
return
if Outfitter:IsMainline() then
if not setting.Tree1 and GetSpecialization() == 1
or not setting.Tree2 and GetSpecialization() == 2
or not setting.Tree3 and GetSpecialization() == 3
or not setting.Tree4 and GetSpecialization() == 4 then
equip = false
return
end
end
]]
end
Expand Down Expand Up @@ -323,11 +324,13 @@ or (setting.DisablePVP and UnitIsPVP("player")) then
end
-- Return if they're not in an enabled spec
if not setting.Tree1 and GetSpecialization() == 1
or not setting.Tree2 and GetSpecialization() == 2
or not setting.Tree3 and GetSpecialization() == 3
or not setting.Tree4 and GetSpecialization() == 4 then
return
if Outfitter:IsMainline() then
if not setting.Tree1 and GetSpecialization() == 1
or not setting.Tree2 and GetSpecialization() == 2
or not setting.Tree3 and GetSpecialization() == 3
or not setting.Tree4 and GetSpecialization() == 4 then
return
end
end
-- Return if the user isn't in full control
Expand Down Expand Up @@ -358,7 +361,7 @@ end

function Outfitter:GenerateDruidShapeshiftScript(pEventID, pDescription)
return
self:GenerateScriptHeader({pEventID, 'NOT_'..pEventID, 'OUTFIT_EQUIPPED'}, pDescription)..
self:GenerateScriptHeader({pEventID, 'NOT_'..pEventID, 'PLAYER_TALENT_UPDATE', 'OUTFIT_EQUIPPED'}, pDescription)..
[[
-- $SETTING DisableBG={type="boolean", label="Don't equip in Battlegrounds", default=false}
-- $SETTING DisablePVP={type="boolean", label="Don't equip while PvP flagged", default=false}
Expand All @@ -376,11 +379,13 @@ or (setting.DisablePVP and UnitIsPVP("player")) then
end
-- Return if they're not in an enabled spec
if not setting.Tree1 and GetSpecialization() == 1
or not setting.Tree2 and GetSpecialization() == 2
or not setting.Tree3 and GetSpecialization() == 3
or not setting.Tree4 and GetSpecialization() == 4 then
return
if Outfitter:IsMainline() then
if not setting.Tree1 and GetSpecialization() == 1
or not setting.Tree2 and GetSpecialization() == 2
or not setting.Tree3 and GetSpecialization() == 3
or not setting.Tree4 and GetSpecialization() == 4 then
return
end
end
-- Return if the user isn't in full control
Expand All @@ -389,6 +394,12 @@ if not Outfitter.IsDead and not HasFullControl() then
return
end
-- If spec changed, unequip any form (default to caster)
if event == "PLAYER_TALENT_UPDATE" then
print("Player changed specs, we should unequip")
equip = false
end
-- If the user is manually equipping the outfit, let
-- Outfitter know which layer it's representing
Expand Down Expand Up @@ -1003,11 +1014,13 @@ or (setting.DisablePVP and UnitIsPVP("player")) then
end
-- Return if they're not in an enabled spec
if not setting.Tree1 and GetSpecialization() == 1
or not setting.Tree2 and GetSpecialization() == 2
or not setting.Tree3 and GetSpecialization() == 3
or not setting.Tree4 and GetSpecialization() == 4 then
return
if Outfitter:IsMainline() then
if not setting.Tree1 and GetSpecialization() == 1
or not setting.Tree2 and GetSpecialization() == 2
or not setting.Tree3 and GetSpecialization() == 3
or not setting.Tree4 and GetSpecialization() == 4 then
return
end
end
-- Return if the user isn't in full control
Expand Down

0 comments on commit 34a5208

Please sign in to comment.