Skip to content

Trigger API Reference DCEI Functions Effect0

BlackTower edited this page Jul 28, 2022 · 2 revisions
Table of Contents

Trigger API Reference\DCEI Functions\Effect {Trigger-API-ReferenceDCEI-FunctionsEffect}

string GetEffectType(string effectName) {string-GetEffectTypestring-effectName}

string GetEffectType(string effectName)

Description

Returns the effect type of an effect as a string.

Parameters

  • string effectName the name of the effect to check the type of.

Example Usage

local effect_type = DCEI.GetEffectType("DoNothing")
DCEI.LogMessage(effect_type)

void CreateEffect(string effectName, unit target) {void-CreateEffectstring-effectName-unit-target}

void CreateEffect(string effectName, unit target)

Description

Creates an effect targeting a unit. There is no source or caster unit.

Parameters

  • string effectName the name of the effect to create.
  • unit target the unit to target with the effect.

Example Usage

local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local test_subject = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffect("Kill", test_subject)

void CreateEffectAtUnit(string effectName, unit target) {void-CreateEffectAtUnitstring-effectName-unit-target}

void CreateEffectAtUnit(string effectName, unit target)

Description

Creates an effect targeting a unit. There is no source or caster unit.

Parameters

  • string effectName the name of the effect to create.
  • unit target the unit to target with the effect.

Example Usage

local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local test_subject = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffectAtUnit("Kill", test_subject)

void CreateEffect(string effectName, unit caster, unit source, unit target) {void-CreateEffectstring-effectName-unit-caster-unit-source-unit-target}

void CreateEffect(string effectName, unit caster, unit source, unit target)

Description

Create an effect targeting a unit via a source unit as if cast by another unit.

Parameters

  • string effectName the name of the effect to create.
  • unit caster the unit that is considered to be the caster of the effect.
  • unit source the unit to treat as the effect source.
  • unit target the unit to target with the effect.

Example Usage

local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local caster = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
local source = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
local target = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffect("Kill", caster, source, target)

void CreateEffectAtUnit(string effectName, unit target, unit caster, unit source) {void-CreateEffectAtUnitstring-effectName-unit-target-unit-caster-unit-source}

void CreateEffectAtUnit(string effectName, unit target, unit caster, unit source)

Description

Create an effect targeting a unit via a source unit as if cast by another unit.

Parameters

  • string effectName the name of the effect to create.
  • unit caster the unit that is considered to be the caster of the effect.
  • unit source the unit to treat as the effect source.
  • unit target the unit to target with the effect.

Example Usage

local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local caster = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
local source = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
local target = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffectAtUnit("Kill", caster, source, target)

void CreateEffect(string effectName, unit caster, float x, float z) {void-CreateEffectstring-effectName-unit-caster-float-x-float-z}

void CreateEffect(string effectName, unit caster, float x, float z)

Description

Creates an effect from a unit targeting a point.

Parameters

  • string effectName the name of the effect to create.
  • unit caster the unit that is considered to be the caster of the effect.
  • float x the x-axis coordinate to cast the ability at.
  • float z the z-axis coordinate to cast the ability at.

Example Usage

local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local test_subject = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffect("Kill", test_subject)

void CreateEffectAtPosition(string effectName, unit caster, float x, float z) {void-CreateEffectAtPositionstring-effectName-unit-caster-float-x-float-z}

void CreateEffectAtPosition(string effectName, unit caster, float x, float z)

Description

Creates an effect from a unit targeting a point.

Parameters

  • string effectName the name of the effect to create.
  • unit caster the unit that is considered to be the caster of the effect.
  • float x the x-axis coordinate to cast the ability at.
  • float z the z-axis coordinate to cast the ability at.

Example Usage

local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local test_subject = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffectAtPosition("Kill", test_subject)

Clone this wiki locally