From 860bf84280d2e099bc88eb2211bbdfa6533d3a0d Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 9 Jan 2022 14:12:34 -0500 Subject: [PATCH] Core/ZoneScript: Add "invoker" param to ProcessEvent Port From (https://github.com/TrinityCore/TrinityCore/commit/15b91836351a61f471865a751d4ff9ab0b5775a0) --- Source/Game/BattleFields/Zones/WinterGrasp.cs | 2 +- Source/Game/Entities/GameObject/GameObject.cs | 2 +- Source/Game/Maps/ZoneScript.cs | 2 +- Source/Game/Spells/SpellEffects.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Game/BattleFields/Zones/WinterGrasp.cs b/Source/Game/BattleFields/Zones/WinterGrasp.cs index 79402864c..4f5d63006 100644 --- a/Source/Game/BattleFields/Zones/WinterGrasp.cs +++ b/Source/Game/BattleFields/Zones/WinterGrasp.cs @@ -870,7 +870,7 @@ namespace Game.BattleFields } } - public override void ProcessEvent(WorldObject obj, uint eventId) + public override void ProcessEvent(WorldObject obj, uint eventId, WorldObject invoker) { if (!obj || !IsWarTime()) return; diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index f36391212..6900343a7 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -2201,7 +2201,7 @@ namespace Game.Entities GetAI().EventInform(eventId); if (m_zoneScript != null) - m_zoneScript.ProcessEvent(this, eventId); + m_zoneScript.ProcessEvent(this, eventId, invoker); BattlegroundMap bgMap = GetMap().ToBattlegroundMap(); if (bgMap) diff --git a/Source/Game/Maps/ZoneScript.cs b/Source/Game/Maps/ZoneScript.cs index d93e3b45f..b2707bc78 100644 --- a/Source/Game/Maps/ZoneScript.cs +++ b/Source/Game/Maps/ZoneScript.cs @@ -44,7 +44,7 @@ namespace Game.Maps public virtual uint GetData(uint dataId) { return 0; } public virtual void SetData(uint dataId, uint value) { } - public virtual void ProcessEvent(WorldObject obj, uint eventId) { } + public virtual void ProcessEvent(WorldObject obj, uint eventId, WorldObject invoker) { } protected EventMap _events = new(); } diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index 62175a4d1..c04ce312b 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -720,9 +720,9 @@ namespace Game.Spells ZoneScript zoneScript = m_caster.GetZoneScript(); InstanceScript instanceScript = m_caster.GetInstanceScript(); if (zoneScript != null) - zoneScript.ProcessEvent(target, (uint)effectInfo.MiscValue); + zoneScript.ProcessEvent(target, (uint)effectInfo.MiscValue, m_caster); else if (instanceScript != null) // needed in case Player is the caster - instanceScript.ProcessEvent(target, (uint)effectInfo.MiscValue); + instanceScript.ProcessEvent(target, (uint)effectInfo.MiscValue, m_caster); m_caster.GetMap().ScriptsStart(ScriptsType.Event, (uint)effectInfo.MiscValue, m_caster, target); }