From 34a5208e0b461e017dc7ba80af850f78711b09f4 Mon Sep 17 00:00:00 2001 From: govtgeek <26489473+GovtGeek@users.noreply.github.com> Date: Sun, 31 Mar 2024 20:07:25 -0700 Subject: [PATCH] Updated Druid scripts to handle classic and retail --- OutfitterScripting.lua | 59 ++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/OutfitterScripting.lua b/OutfitterScripting.lua index ca8672e..1ad4b70 100644 --- a/OutfitterScripting.lua +++ b/OutfitterScripting.lua @@ -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 @@ -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 @@ -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} @@ -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 @@ -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 @@ -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