Functions for working with magic.
local Magic = ELONA.require("core.Magic")
cast (caster, target, effect_id, effect_power) | Makes a character cast a spell targeting another character. |
cast (caster, effect_id, effect_power, target_location) | Makes a character cast a spell targeting themselves or a position. |
Makes a character cast a spell targeting another character.
Parameters:
local caster = Chara.player()
local target = Chara.create(0, 0, "core.putit")
Magic.cast(caster, target, 414, 100) -- Magic missile
Makes a character cast a spell targeting themselves or a position.
Parameters:
local pos = Map.random_pos()
Magic.cast(Chara.player(), 432, 100, pos) -- Ball magic