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;
|
||||
}
|
||||
|
||||
public uint? GetInstanceIdBySceneId(uint sceneId)
|
||||
{
|
||||
foreach (var (instanceId, template) in _scenesByInstance)
|
||||
if (template.SceneId == sceneId)
|
||||
return instanceId;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void TriggerDelayedScenes()
|
||||
{
|
||||
foreach (var playScene in _delayedScenes)
|
||||
|
||||
@@ -5887,8 +5887,16 @@ namespace Game.Spells
|
||||
if (apply)
|
||||
player.GetSceneMgr().PlayScene((uint)GetMiscValue());
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.AreaTrigger)]
|
||||
void HandleCreateAreaTrigger(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
|
||||
Reference in New Issue
Block a user