Trigger API Reference DCEI Events Effect0 - BLKTower/TestWiki GitHub Wiki
Trigger API Reference\DCEI Events\Effect {Trigger-API-ReferenceDCEI-EventsEffect}
void TriggerAddEffectEvent(string effectName, TypedCallback<EffectContext> trigger, bool simple) {void-TriggerAddEffectEventstring-effectName-TypedCallbackEffectContext-trigger-bool-simple}
void TriggerAddEffectEvent(string effectName, TypedCallback<EffectContext> trigger, bool simple)
This event is triggered when an effect occurs. Use TriggeringEffectName and TriggeringEffectContext to get the name and context of the effect. This function can also pass the effect context as a parameter to the callback function.
-
string
effectName
the name of the effect which triggers the event. -
object
trigger
the callback function that is run when the event is triggered. -
bool
simple
this flag reduces overhead by preventing the usage of DCEI.Wait() within the trigger. You should only set this to true if the trigger does not use DCEI.Wait().
-
EffectContext
effect_context
function OnDoNothing(effect_context)
local context = DCEI.TriggeringEffectContext
local caster_name = DCEI.UnitName(context.caster)
local source_name = DCEI.UnitName(context.source)
local target_name = DCEI.UnitName(context.target)
DCEI.LogMessage(caster_name .. " did nothing to " .. target_name .. " via " .. source_name .. ".")
end
DCEI.TriggerAddEffectEvent("DoNothing", OnDoNothing, true)