Trigger API Reference DCEI Events Effect0 - BLKTower/TestWiki GitHub Wiki

Table of Contents

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)

Description

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.

Parameters

  • 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().

Callback Parameters

  • EffectContext effect_context

Example Usage

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)

Related

⚠️ **GitHub.com Fallback** ⚠️