diff --git a/Source/Framework/Constants/Spells/SpellAuraConst.cs b/Source/Framework/Constants/Spells/SpellAuraConst.cs index 77ea666bf..00b89811f 100644 --- a/Source/Framework/Constants/Spells/SpellAuraConst.cs +++ b/Source/Framework/Constants/Spells/SpellAuraConst.cs @@ -453,7 +453,7 @@ namespace Framework.Constants ModLeech = 443, // NYI Unk444 = 444, Unk445 = 445, - Unk446 = 446, + AdvFlying = 446, ModXpFromCreatureType = 447, Unk448 = 448, Unk449 = 449, diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index c200623dd..60cde2f42 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -5788,11 +5788,11 @@ namespace Game.Entities { AuraType.ModFear, AuraType.Transform, AuraType.WaterWalk, AuraType.FeatherFall, AuraType.Hover, AuraType.SafeFall, - AuraType.Fly, AuraType.ModIncreaseMountedFlightSpeed, AuraType.None + AuraType.Fly, AuraType.ModIncreaseMountedFlightSpeed, AuraType.AdvFlying }; - foreach (var aura in auratypes) + foreach (var auraType in auratypes) { - var auraList = GetAuraEffectsByType(aura); + var auraList = GetAuraEffectsByType(auraType); if (!auraList.Empty()) auraList.First().HandleEffect(this, AuraEffectHandleModes.SendForClient, true); } diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index e072e1413..53a804ddc 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -154,7 +154,7 @@ namespace Game.Entities public float GetSpeedRate(UnitMoveType mtype) { return m_speed_rate[(int)mtype]; } - void SetFlightCapabilityID(int flightCapabilityId, bool clientUpdate) + public void SetFlightCapabilityID(int flightCapabilityId, bool clientUpdate) { if (flightCapabilityId != 0 && !CliDB.FlightCapabilityStorage.HasRecord((uint)flightCapabilityId)) return; @@ -1053,8 +1053,11 @@ namespace Game.Entities { var capability = CliDB.MountCapabilityStorage.LookupByKey(aurEff.GetAmount()); if (capability != null) // aura may get removed by interrupt flag, reapply + { + SetFlightCapabilityID(capability.FlightCapabilityID, true); if (!HasAura(capability.ModSpellAuraID)) CastSpell(this, capability.ModSpellAuraID, new CastSpellExtraArgs(aurEff)); + } } } } @@ -1731,7 +1734,7 @@ namespace Game.Entities RemoveNpcFlag(NPCFlags.SpellClick | NPCFlags.PlayerVehicle); } - bool SetCanAdvFly(bool enable) + public bool SetCanAdvFly(bool enable) { if (enable == HasExtraUnitMovementFlag2(MovementFlags3.CanAdvFly)) return false; diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index 5fffb1d56..14ab293ca 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -2219,7 +2219,10 @@ namespace Game.Spells { var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount()); if (mountCapability != null) + { + target.SetFlightCapabilityID(mountCapability.FlightCapabilityID, true); target.CastSpell(target, mountCapability.ModSpellAuraID, new CastSpellExtraArgs(this)); + } } } else @@ -2239,6 +2242,8 @@ namespace Game.Spells var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount()); if (mountCapability != null) target.RemoveAurasDueToSpell(mountCapability.ModSpellAuraID, target.GetGUID()); + + target.SetFlightCapabilityID(0, true); } } } @@ -2373,6 +2378,18 @@ namespace Game.Spells target.SetCanTurnWhileFalling(apply); } + [AuraEffectHandler(AuraType.AdvFlying)] + void HandleModAdvFlying(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) + { + if (!mode.HasAnyFlag(AuraEffectHandleModes.SendForClientMask)) + return; + + Unit target = aurApp.GetTarget(); + target.SetCanDoubleJump(apply || target.HasAura(196055)); + target.SetCanFly(apply); + target.SetCanAdvFly(apply); + } + [AuraEffectHandler(AuraType.IgnoreMovementForces)] void HandleIgnoreMovementForces(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) {