Core/Auras: Implemented new aura type 487 (SPELL_AURA_COSMETIC_MOUNTED)
Port From (https://github.com/TrinityCore/TrinityCore/commit/a0c4a3071cebf3d755a9bdb8e07d93b17f354db3)
This commit is contained in:
@@ -508,7 +508,7 @@ namespace Framework.Constants
|
||||
AllowInterruptSpell = 484, // NYI
|
||||
ModMovementForceMagnitude = 485,
|
||||
Unk486 = 486,
|
||||
Unk487 = 487,
|
||||
CosmeticMounted = 487,
|
||||
Unk488 = 488,
|
||||
Unk489 = 489,
|
||||
Unk490 = 490,
|
||||
|
||||
@@ -1159,7 +1159,7 @@ namespace Game.Entities
|
||||
public UpdateField<uint> NativeDisplayID = new(32, 53);
|
||||
public UpdateField<float> NativeXDisplayScale = new(32, 54);
|
||||
public UpdateField<uint> MountDisplayID = new(32, 55);
|
||||
public UpdateField<int> CosmeticMountDisplayID = new(32, 56);
|
||||
public UpdateField<uint> CosmeticMountDisplayID = new(32, 56);
|
||||
public UpdateField<float> MinDamage = new(32, 57);
|
||||
public UpdateField<float> MaxDamage = new(32, 58);
|
||||
public UpdateField<float> MinOffHandDamage = new(32, 59);
|
||||
@@ -1319,7 +1319,7 @@ namespace Game.Entities
|
||||
data.WriteUInt32(NativeDisplayID);
|
||||
data.WriteFloat(NativeXDisplayScale);
|
||||
data.WriteUInt32(MountDisplayID);
|
||||
data.WriteInt32(CosmeticMountDisplayID);
|
||||
data.WriteUInt32(CosmeticMountDisplayID);
|
||||
if (fieldVisibilityFlags.HasFlag(UpdateFieldFlag.Owner) || fieldVisibilityFlags.HasFlag(UpdateFieldFlag.Empath))
|
||||
{
|
||||
data.WriteFloat(MinDamage);
|
||||
@@ -1732,7 +1732,7 @@ namespace Game.Entities
|
||||
}
|
||||
if (changesMask[56])
|
||||
{
|
||||
data.WriteInt32(CosmeticMountDisplayID);
|
||||
data.WriteUInt32(CosmeticMountDisplayID);
|
||||
}
|
||||
if (changesMask[57])
|
||||
{
|
||||
|
||||
@@ -1301,6 +1301,7 @@ namespace Game.Entities
|
||||
|
||||
public void Mount(uint mount, uint VehicleId = 0, uint creatureEntry = 0)
|
||||
{
|
||||
RemoveAurasByType(AuraType.CosmeticMounted);
|
||||
if (mount != 0)
|
||||
SetMountDisplayId(mount);
|
||||
|
||||
|
||||
@@ -1791,6 +1791,8 @@ namespace Game.Entities
|
||||
}
|
||||
public uint GetMountDisplayId() { return m_unitData.MountDisplayID; }
|
||||
public void SetMountDisplayId(uint mountDisplayId) { SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.MountDisplayID), mountDisplayId); }
|
||||
uint GetCosmeticMountDisplayId() { return m_unitData.CosmeticMountDisplayID; }
|
||||
public void SetCosmeticMountDisplayId(uint mountDisplayId) { SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.CosmeticMountDisplayID), mountDisplayId); }
|
||||
|
||||
public virtual float GetFollowAngle() { return MathFunctions.PiOver2; }
|
||||
|
||||
|
||||
@@ -5753,6 +5753,24 @@ namespace Game.Spells
|
||||
else if (!playerTarget.GetSession().IsLogingOut())
|
||||
playerTarget.RemoveStoredAuraTeleportLocation(GetSpellInfo().Id);
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.StoreTeleportReturnPoint)]
|
||||
void HandleCosmeticMounted(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||
return;
|
||||
|
||||
if (apply)
|
||||
aurApp.GetTarget().SetCosmeticMountDisplayId((uint)GetMiscValue());
|
||||
else
|
||||
aurApp.GetTarget().SetCosmeticMountDisplayId(0); // set cosmetic mount to 0, even if multiple auras are active; tested with zandalari racial + divine steed
|
||||
|
||||
Player playerTarget = aurApp.GetTarget().ToPlayer();
|
||||
if (playerTarget == null)
|
||||
return;
|
||||
|
||||
playerTarget.SendMovementSetCollisionHeight(playerTarget.GetCollisionHeight(), UpdateCollisionHeightReason.Force);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -40,9 +40,12 @@ namespace Scripts.Spells.Paladin
|
||||
public const uint ConcentractionAura = 19746;
|
||||
public const uint DivinePurposeProc = 90174;
|
||||
public const uint DivineSteedHuman = 221883;
|
||||
public const uint DivineSteedDwarf = 276111;
|
||||
public const uint DivineSteedDraenei = 221887;
|
||||
public const uint DivineSteedDarkIronDwarf = 276112;
|
||||
public const uint DivineSteedBloodelf = 221886;
|
||||
public const uint DivineSteedTauren = 221885;
|
||||
public const uint DivineSteedZandalariTroll = 294133;
|
||||
public const uint DivineStormDamage = 224239;
|
||||
public const uint EnduringLight = 40471;
|
||||
public const uint EnduringJudgement = 40472;
|
||||
@@ -240,7 +243,7 @@ namespace Scripts.Spells.Paladin
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.DivineSteedHuman, SpellIds.DivineSteedDraenei, SpellIds.DivineSteedBloodelf, SpellIds.DivineSteedTauren);
|
||||
return ValidateSpellInfo(SpellIds.DivineSteedHuman, SpellIds.DivineSteedDwarf, SpellIds.DivineSteedDraenei, SpellIds.DivineSteedDarkIronDwarf, SpellIds.DivineSteedBloodelf, SpellIds.DivineSteedTauren, SpellIds.DivineSteedZandalariTroll);
|
||||
}
|
||||
|
||||
void HandleOnCast()
|
||||
@@ -250,15 +253,28 @@ namespace Scripts.Spells.Paladin
|
||||
uint spellId = SpellIds.DivineSteedHuman;
|
||||
switch (caster.GetRace())
|
||||
{
|
||||
case Race.Human:
|
||||
spellId = SpellIds.DivineSteedHuman;
|
||||
break;
|
||||
case Race.Dwarf:
|
||||
spellId = SpellIds.DivineSteedDwarf;
|
||||
break;
|
||||
case Race.Draenei:
|
||||
case Race.LightforgedDraenei:
|
||||
spellId = SpellIds.DivineSteedDraenei;
|
||||
break;
|
||||
case Race.DarkIronDwarf:
|
||||
spellId = SpellIds.DivineSteedDarkIronDwarf;
|
||||
break;
|
||||
case Race.BloodElf:
|
||||
spellId = SpellIds.DivineSteedBloodelf;
|
||||
break;
|
||||
case Race.Tauren:
|
||||
spellId = SpellIds.DivineSteedTauren;
|
||||
break;
|
||||
case Race.ZandalariTroll:
|
||||
spellId = SpellIds.DivineSteedZandalariTroll;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user