diff --git a/Source/Game/DataStorage/Structs/M_Records.cs b/Source/Game/DataStorage/Structs/M_Records.cs index 6a76bc5b9..93c30bc0b 100644 --- a/Source/Game/DataStorage/Structs/M_Records.cs +++ b/Source/Game/DataStorage/Structs/M_Records.cs @@ -137,7 +137,9 @@ namespace Game.DataStorage public uint Id; public uint PlayerConditionId; public byte UiModelSceneID; - } + + public bool IsSelfMount() { return (Flags & (ushort)MountFlags.SelfMount) != 0; } +} public sealed class MountCapabilityRecord { diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index a8b01ba3c..29c1f18e7 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -2177,21 +2177,28 @@ namespace Game.Spells var mountDisplays = Global.DB2Mgr.GetMountDisplays(mountEntry.Id); if (mountDisplays != null) { - List usableDisplays = mountDisplays.Where(mountDisplay => + if (mountEntry.IsSelfMount()) { - Player playerTarget = target.ToPlayer(); - if (playerTarget) + displayId = 73200; //DisplayId: HiddenMount + } + else + { + List usableDisplays = mountDisplays.Where(mountDisplay => { - PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(mountDisplay.PlayerConditionID); - if (playerCondition != null) - return ConditionManager.IsPlayerMeetingCondition(playerTarget, playerCondition); - } + Player playerTarget = target.ToPlayer(); + if (playerTarget) + { + PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(mountDisplay.PlayerConditionID); + if (playerCondition != null) + return ConditionManager.IsPlayerMeetingCondition(playerTarget, playerCondition); + } - return true; - }).ToList(); + return true; + }).ToList(); - if (!usableDisplays.Empty()) - displayId = usableDisplays.SelectRandom().DisplayID; + if (!usableDisplays.Empty()) + displayId = usableDisplays.SelectRandom().DisplayID; + } } // TODO: CREATE TABLE mount_vehicle (mountId, vehicleCreatureId) for future mounts that are vehicles (new mounts no longer have proper data in MiscValue) //if (MountVehicle const* mountVehicle = sObjectMgr->GetMountVehicle(mountEntry->Id)) @@ -2203,7 +2210,7 @@ namespace Game.Spells { vehicleId = creatureInfo.VehicleId; - if (displayId == 0 || vehicleId != 0) + if (displayId == 0) { displayId = ObjectManager.ChooseDisplayId(creatureInfo); Global.ObjectMgr.GetCreatureModelRandomGender(ref displayId); diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 2e84fd9e0..4490bcfe1 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -306,8 +306,7 @@ namespace Scripts.Spells.Generic public const uint GoblinMale = 31002; public const uint GoblinFemale = 31003; - //RunningWild - public const uint RunningWild = 73200; + public const uint HiddenMount = 73200; } struct TextIds @@ -2246,7 +2245,7 @@ namespace Scripts.Spells.Generic { public override bool Validate(SpellInfo spellInfo) { - if (!CliDB.CreatureDisplayInfoStorage.ContainsKey(ModelIds.RunningWild)) + if (!CliDB.CreatureDisplayInfoStorage.ContainsKey(ModelIds.HiddenMount)) return false; return true; } @@ -2256,7 +2255,7 @@ namespace Scripts.Spells.Generic Unit target = GetTarget(); PreventDefaultAction(); - target.Mount(ModelIds.RunningWild, 0, 0); + target.Mount(ModelIds.HiddenMount, 0, 0); // cast speed aura MountCapabilityRecord mountCapability = CliDB.MountCapabilityStorage.LookupByKey(aurEff.GetAmount());