package FieldGenerator import Fx2Entity import ClosureForGroups constant SPELL_ID = 'A027' constant BUFF_ID = 'AAAA' enum FieldType TIMED_BUFF TIMED_DEBUFF SHIELD public function FieldType.toColor() returns colorA switch this case TIMED_BUFF return colorA(55, 245, 55, 255) case TIMED_DEBUFF return colorA(245, 55, 55, 255) case SHIELD return colorA(222, 222, 75, 255) class ForceField extends Fx2Entity FieldType ftype construct(unit caster, vec2 position) super(caster.getOwner(), position.toVec3(), angle(0), "war3mapImported\\ForceField.mdx") chooseFieldType() function chooseFieldType() ftype = GetRandomInt(0, 2) castTo FieldType fx.eff ..setColor(ftype.toColor()) ..setScale(0.55) init // EventListener.onPointCast(SPELL_ID) (caster, target) -> // new ForceField(caster, target) forUnitsInRange(ZERO2, 128) u -> u.addHP(100)