Core/Auras: Send scene complete if a SPELL_AURA_PLAY_SCENE aura is removed by expiration
Port From (https://github.com/TrinityCore/TrinityCore/commit/e58fa4c35eaf24cfa4866b8ca24a61d45a3382d2)
This commit is contained in:
@@ -223,6 +223,15 @@ namespace Game.Entities
|
|||||||
return activeSceneCount;
|
return activeSceneCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public uint? GetInstanceIdBySceneId(uint sceneId)
|
||||||
|
{
|
||||||
|
foreach (var (instanceId, template) in _scenesByInstance)
|
||||||
|
if (template.SceneId == sceneId)
|
||||||
|
return instanceId;
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void TriggerDelayedScenes()
|
public void TriggerDelayedScenes()
|
||||||
{
|
{
|
||||||
foreach (var playScene in _delayedScenes)
|
foreach (var playScene in _delayedScenes)
|
||||||
|
|||||||
@@ -5887,7 +5887,15 @@ namespace Game.Spells
|
|||||||
if (apply)
|
if (apply)
|
||||||
player.GetSceneMgr().PlayScene((uint)GetMiscValue());
|
player.GetSceneMgr().PlayScene((uint)GetMiscValue());
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (aurApp.GetRemoveMode() == AuraRemoveMode.Expire)
|
||||||
|
{
|
||||||
|
var sceneInstanceId = player.GetSceneMgr().GetInstanceIdBySceneId((uint)GetMiscValue());
|
||||||
|
if (sceneInstanceId.HasValue)
|
||||||
|
player.GetSceneMgr().OnSceneComplete(sceneInstanceId.Value);
|
||||||
|
}
|
||||||
player.GetSceneMgr().CancelSceneBySceneId((uint)GetMiscValue());
|
player.GetSceneMgr().CancelSceneBySceneId((uint)GetMiscValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.AreaTrigger)]
|
[AuraEffectHandler(AuraType.AreaTrigger)]
|
||||||
|
|||||||
Reference in New Issue
Block a user