Core/Creatures: Implement Ground/FlyingMountDisplayID from creature_summoned_data
Port From (https://github.com/TrinityCore/TrinityCore/commit/8cbc3923a18add49dd483e0e6e9d851f1d4d59f7)
This commit is contained in:
@@ -4695,6 +4695,44 @@ namespace Scripts.Spells.Generic
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 147066 - (Serverside/Non-DB2) Generic - Mount Check Aura
|
||||
class spell_gen_mount_check_aura : AuraScript
|
||||
{
|
||||
void OnPeriodic(AuraEffect aurEff)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
uint mountDisplayId = 0;
|
||||
|
||||
TempSummon tempSummon = target.ToTempSummon();
|
||||
if (tempSummon == null)
|
||||
return;
|
||||
|
||||
Player summoner = tempSummon.GetSummoner()?.ToPlayer();
|
||||
if (summoner == null)
|
||||
return;
|
||||
|
||||
if (summoner.IsMounted() && (!summoner.IsInCombat() || summoner.IsFlying()))
|
||||
{
|
||||
CreatureSummonedData summonedData = Global.ObjectMgr.GetCreatureSummonedData(tempSummon.GetEntry());
|
||||
if (summonedData != null)
|
||||
{
|
||||
if (summoner.IsFlying() && summonedData.FlyingMountDisplayID.HasValue)
|
||||
mountDisplayId = summonedData.FlyingMountDisplayID.Value;
|
||||
else if (summonedData.GroundMountDisplayID.HasValue)
|
||||
mountDisplayId = summonedData.GroundMountDisplayID.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (mountDisplayId != target.GetMountDisplayId())
|
||||
target.SetMountDisplayId(mountDisplayId);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(OnPeriodic, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
// 40307 - Stasis Field
|
||||
class StasisFieldSearcher : ICheck<Unit>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user