Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/tindral sageswift #269

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
libs/LibBabble-SubZone-3.0/
libs/LibBabble-SubZone-3.0/
.vscode/settings.json
3 changes: 3 additions & 0 deletions Versions/Common/bestride.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ function BeStride:OnEnable()

BeStride:RegisterEvent("PLAYER_REGEN_DISABLED", "EventCombatEnter")
BeStride:RegisterEvent("PLAYER_REGEN_ENABLED", "EventCombatExit")

BeStride:RegisterEvent("ENCOUNTER_START", function(encounterId) BeStride.encounterId = encounterId end)
BeStride:RegisterEvent("ENCOUNTER_END", function() BeStride.encounterId = nil end)

BeStride:Upgrade()
end
Expand Down
31 changes: 31 additions & 0 deletions Versions/Common/logic.zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,37 @@ function BeStride:IsSpecialZone()
return false
end

-- { DungeonEncounterID, maybeEnablingSpellId, BeStride_Mount:FnName }
BeStride.knownEncounters = {
{
2786, -- Tindral Sageswift, Seer of the Flame; Amirdrassil, the Dream's Hope
415095, -- Empowered Feather is the buff that enables Dragonriding
"Dragonriding" -- BeStride_Mount Function to call - This is a dragonriding encounter, so call dragonriding
}
}

-- Some encounters, such as Tindral Sageswift in 10.2's Amirdrassil, require mounting
-- as a part of the encounter. Check for known cases and enable BeStride Mounting during
-- these encounters.
function BeStride:IsKnownSpecialCombatEncounter()
if not BeStride:IsCombat() or BeStride.encounterId == nil then
return nil
end

for _, encounter in pairs(BeStride.knownEncounters) do
local encounterId, maybeEnablingSpellId = unpack(encounter)
if BeStride.encounterId == encounterId then
if maybeEnablingSpellId ~= nil then
local isProperAuraCurrentlyApplied = C_UnitAuras.GetPlayerAuraBySpellID(maybeEnablingSpellId) ~= nil
return isProperAuraCurrentlyApplied and encounter or nil
else
-- If we're in a known encounter but there's no Spell ID required, assume we can mount I guess?
return encounter
end
end
end
end

function BeStride:WGActive()
return true
end
5 changes: 4 additions & 1 deletion Versions/Common/mount.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
function BeStride:Regular()
if self:CanUseTargetsMount() then
if self:IsKnownSpecialCombatEncounter() then
self:DismountAndExit()
return self:KnownSpecialCombatEncounter()
elseif self:CanUseTargetsMount() then
self:DismountAndExit()
return self:UseTargetsMount()
-- Aspect of the Cheetah is available from level 5
Expand Down
8 changes: 8 additions & 0 deletions Versions/Common/mounting.zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ function BeStride:SpecialZone()
end

return nil
end

function BeStride:KnownSpecialCombatEncounter()
local encounter = self:IsKnownSpecialCombatEncounter()
local _, _, br_mount_fn_name = unpack(encounter or {});
if br_mount_fn_name == nil then return nil end

return BeStride_Mount[br_mount_fn_name]()
end