Core/Auras: Implemented SPELL_AURA_ADV_FLYING
Port From (https://github.com/TrinityCore/TrinityCore/commit/c7a073140cb9cc41aefaff76eca5355acceff409)
This commit is contained in:
@@ -453,7 +453,7 @@ namespace Framework.Constants
|
|||||||
ModLeech = 443, // NYI
|
ModLeech = 443, // NYI
|
||||||
Unk444 = 444,
|
Unk444 = 444,
|
||||||
Unk445 = 445,
|
Unk445 = 445,
|
||||||
Unk446 = 446,
|
AdvFlying = 446,
|
||||||
ModXpFromCreatureType = 447,
|
ModXpFromCreatureType = 447,
|
||||||
Unk448 = 448,
|
Unk448 = 448,
|
||||||
Unk449 = 449,
|
Unk449 = 449,
|
||||||
|
|||||||
@@ -5788,11 +5788,11 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
AuraType.ModFear, AuraType.Transform, AuraType.WaterWalk,
|
AuraType.ModFear, AuraType.Transform, AuraType.WaterWalk,
|
||||||
AuraType.FeatherFall, AuraType.Hover, AuraType.SafeFall,
|
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())
|
if (!auraList.Empty())
|
||||||
auraList.First().HandleEffect(this, AuraEffectHandleModes.SendForClient, true);
|
auraList.First().HandleEffect(this, AuraEffectHandleModes.SendForClient, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public float GetSpeedRate(UnitMoveType mtype) { return m_speed_rate[(int)mtype]; }
|
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))
|
if (flightCapabilityId != 0 && !CliDB.FlightCapabilityStorage.HasRecord((uint)flightCapabilityId))
|
||||||
return;
|
return;
|
||||||
@@ -1053,8 +1053,11 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
var capability = CliDB.MountCapabilityStorage.LookupByKey(aurEff.GetAmount());
|
var capability = CliDB.MountCapabilityStorage.LookupByKey(aurEff.GetAmount());
|
||||||
if (capability != null) // aura may get removed by interrupt flag, reapply
|
if (capability != null) // aura may get removed by interrupt flag, reapply
|
||||||
|
{
|
||||||
|
SetFlightCapabilityID(capability.FlightCapabilityID, true);
|
||||||
if (!HasAura(capability.ModSpellAuraID))
|
if (!HasAura(capability.ModSpellAuraID))
|
||||||
CastSpell(this, capability.ModSpellAuraID, new CastSpellExtraArgs(aurEff));
|
CastSpell(this, capability.ModSpellAuraID, new CastSpellExtraArgs(aurEff));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1731,7 +1734,7 @@ namespace Game.Entities
|
|||||||
RemoveNpcFlag(NPCFlags.SpellClick | NPCFlags.PlayerVehicle);
|
RemoveNpcFlag(NPCFlags.SpellClick | NPCFlags.PlayerVehicle);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SetCanAdvFly(bool enable)
|
public bool SetCanAdvFly(bool enable)
|
||||||
{
|
{
|
||||||
if (enable == HasExtraUnitMovementFlag2(MovementFlags3.CanAdvFly))
|
if (enable == HasExtraUnitMovementFlag2(MovementFlags3.CanAdvFly))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -2219,7 +2219,10 @@ namespace Game.Spells
|
|||||||
{
|
{
|
||||||
var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount());
|
var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount());
|
||||||
if (mountCapability != null)
|
if (mountCapability != null)
|
||||||
|
{
|
||||||
|
target.SetFlightCapabilityID(mountCapability.FlightCapabilityID, true);
|
||||||
target.CastSpell(target, mountCapability.ModSpellAuraID, new CastSpellExtraArgs(this));
|
target.CastSpell(target, mountCapability.ModSpellAuraID, new CastSpellExtraArgs(this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2239,6 +2242,8 @@ namespace Game.Spells
|
|||||||
var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount());
|
var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount());
|
||||||
if (mountCapability != null)
|
if (mountCapability != null)
|
||||||
target.RemoveAurasDueToSpell(mountCapability.ModSpellAuraID, target.GetGUID());
|
target.RemoveAurasDueToSpell(mountCapability.ModSpellAuraID, target.GetGUID());
|
||||||
|
|
||||||
|
target.SetFlightCapabilityID(0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2373,6 +2378,18 @@ namespace Game.Spells
|
|||||||
target.SetCanTurnWhileFalling(apply);
|
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)]
|
[AuraEffectHandler(AuraType.IgnoreMovementForces)]
|
||||||
void HandleIgnoreMovementForces(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleIgnoreMovementForces(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user