diff --git a/XIVComboPlugin/Configuration/CustomComboPreset.cs b/XIVComboPlugin/Configuration/CustomComboPreset.cs index c3516761b..96c74a5ca 100644 --- a/XIVComboPlugin/Configuration/CustomComboPreset.cs +++ b/XIVComboPlugin/Configuration/CustomComboPreset.cs @@ -3,7 +3,7 @@ namespace XIVComboPlugin { - //CURRENT HIGHEST FLAG IS 54 + //CURRENT HIGHEST FLAG IS 57 [Flags] public enum CustomComboPreset : long { @@ -145,6 +145,9 @@ public enum CustomComboPreset : long [CustomComboInfo("ED Aetherflow", "Change Energy Drain into Aetherflow when you have no more Aetherflow stacks", 28, new uint[] { SCH.EnergyDrain })] ScholarEnergyDrainFeature = 1L << 37, + [CustomComboInfo("Summon Fairy", "Change Summon Eos/Serene into Whispering Dawn/Fey Illumination when either fairy is summoned", 28, new uint[] { SCH.WhisperingDawn, SCH.FeyIllumination })] + ScholarSummonFeature = 1L << 57, + // DANCER [CustomComboInfo("AoE GCD procs", "DNC AoE procs turn into their normal abilities when not procced", 38, new uint[] { DNC.Bloodshower, DNC.RisingWindmill })] DancerAoeGcdFeature = 1L << 32, diff --git a/XIVComboPlugin/IconReplacer.cs b/XIVComboPlugin/IconReplacer.cs index e2085eda4..c3c44efb8 100644 --- a/XIVComboPlugin/IconReplacer.cs +++ b/XIVComboPlugin/IconReplacer.cs @@ -827,6 +827,56 @@ private ulong GetIconDetour(byte self, uint actionID) return SCH.EnergyDrain; } + // Change Fairy actions if a fairy is already summoned. + if (Configuration.ComboPresets.HasFlag(CustomComboPreset.ScholarSummonFeature)) + { + var fairySummoned = false; + + // No need to check for fairy if not a SCH + if (job == 28) + { + // No need to check actors if Seraph guage is up, or Dissipation (791 / 0x0317) is active. Check for the Dissipation buff or the gauge/dismissed status produces the exact same result. + if (clientState.JobGauges.Get().SeraphTimer > 0 || clientState.JobGauges.Get().DismissedFairy != 0) + fairySummoned = true; + else + { + var playerId = clientState.LocalPlayer.ActorId; + + // 0th entry is self, can be skipped + for (var i = 1; i < clientState.Actors.Length; i++) + { + var actor = clientState.Actors[i]; + + if (actor == null) + continue; + + if (actor is Dalamud.Game.ClientState.Actors.Types.NonPlayer.BattleNpc bnpc) + { + // Keep looking for Seraph, to prevent flashing the summon commands when she is leaving the battlefield + if (bnpc.OwnerId == playerId && (String.Equals(bnpc.Name, "Eos") || String.Equals(bnpc.Name, "Selene") || String.Equals(bnpc.Name, "Seraph"))) + { + fairySummoned = true; + break; + } + } + } + } + } + + if (actionID == SCH.WhisperingDawn) + { + if (fairySummoned && level >= 20) + return SCH.WhisperingDawn; + return SCH.SummonEos; + } + if (actionID == SCH.FeyIllumination) + { + if (fairySummoned && level >= 40) + return SCH.FeyIllumination; + return SCH.SummonSelene; + } + } + // DANCER // AoE GCDs are split into two buttons, because priority matters @@ -1097,6 +1147,8 @@ private void PopulateDict() customIds.Add(17209); customIds.Add(7501); customIds.Add(21); + customIds.Add(16537); // Whispering Dawn + customIds.Add(16538); // Fey Illumination customIds.Add(DNC.Bloodshower); customIds.Add(DNC.RisingWindmill); customIds.Add(RDM.Verstone); diff --git a/XIVComboPlugin/JobActions/SCH.cs b/XIVComboPlugin/JobActions/SCH.cs index ddc377e0c..e16b35493 100644 --- a/XIVComboPlugin/JobActions/SCH.cs +++ b/XIVComboPlugin/JobActions/SCH.cs @@ -6,6 +6,10 @@ public const uint FeyBless = 16543, Consolation = 16546, EnergyDrain = 167, - Aetherflow = 166; + Aetherflow = 166, + SummonEos = 17215, + SummonSelene = 17216, + WhisperingDawn = 16537, + FeyIllumination = 16538; } }