Core/Auras: Implemented SPELL_AURA_ADV_FLYING

Port From (https://github.com/TrinityCore/TrinityCore/commit/c7a073140cb9cc41aefaff76eca5355acceff409)
This commit is contained in:
Hondacrx
2024-11-10 22:19:03 -05:00
parent 3a4eec6ebd
commit 16f13eece9
4 changed files with 26 additions and 6 deletions
@@ -453,7 +453,7 @@ namespace Framework.Constants
ModLeech = 443, // NYI
Unk444 = 444,
Unk445 = 445,
Unk446 = 446,
AdvFlying = 446,
ModXpFromCreatureType = 447,
Unk448 = 448,
Unk449 = 449,
+3 -3
View File
@@ -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);
}
+5 -2
View File
@@ -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;
+17
View File
@@ -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)
{