Core/ZoneScript: Add "invoker" param to ProcessEvent
Port From (https://github.com/TrinityCore/TrinityCore/commit/15b91836351a61f471865a751d4ff9ab0b5775a0)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user