# Can u check my spell trigger please? TY

#### HaaG

Level 5
Hello, My trigger seems to work and I don't see mistakes. But I thought You could check to make sure.

The spell is like this: A Lightning shield to deal x1 intel of the caster each second around the target unit cast in a range of 200 to all enemy units for 12 seconds. I tested it and works fine, but you never know.

Troll Shield Spell
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Lightning Shield
Actions
Set TrollShieldDMG[(Player number of (Owner of (Casting unit)))] = ((Intelligence of (Casting unit) (Include bonuses)) + 1)
Set TrollShieldCaster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
Set TrollShieldTarget[(Player number of (Owner of (Casting unit)))] = (Target unit of ability being cast)
Set TrollShieldTime[(Player number of (Owner of (Casting unit)))] = 12
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Wait 1.00 seconds
Set TrollShieldTime[(Player number of (Owner of (Casting unit)))] = (TrollShieldTime[(Player number of (Owner of (Casting unit)))] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TrollShieldTime[(Player number of (Owner of TrollShieldCaster[(Player number of (Owner of (Casting unit)))]))] Greater than or equal to 1
Then - Actions
Set TrollShieldGroupDMG = (Units within 200.00 of (Position of TrollShieldTarget[(Player number of (Owner of (Casting unit)))]) matching (((Matching unit) belongs to an enemy of (Owner of TrollShieldTarget[(Player number of (Owner of (Casting unit)))])) Equal to True))
Unit Group - Pick every unit in TrollShieldGroupDMG and do (Unit - Cause TrollShieldTarget[(Player number of (Owner of (Casting unit)))] to damage (Picked unit), dealing (Real(TrollShieldDMG[(Player number of (Owner of (Casting unit)))])) damage of attack type Spells and damage type Normal)
Custom script: call DestroyGroup(udg_TrollShieldGroupDMG)
Else - Actions

#### Unregret

Level 14
You should do "dynamic indexing" to make this spell MUI (Multi Unit Instanceable), instead of MPI (Multi Player Instanceable). Besides, use "timer" and don't use wait in your spell because it's inaccurate.
In short, your current caster duration will be overlaped if same unit of same player casts same spell during that time.
This GUI structure suitable when each player triggers this event one time only, rather than spells.

#### HaaG

Level 5
Yes, Thank you very much, MPI is just what I need. So basically you mean if I use a timer, it could become MUI? I understand, although my skills are limited and I would have trouble making it MUI.

#### Unregret

Level 14
Yes, Thank you very much, MPI is just what I need. So basically you mean if I use a timer, it could become MUI? I understand, although my skills are limited and I would have trouble making it MUI.
It is better in all the way you want players option to choose similar heroes in one map.

#### millzy

Level 15
you will want to use a timer trigger instead of a loop with a wait. even with it only being MPI.

#### HaaG

Level 5
How to edit it with timer trigger guys for MUI if I wanted it? And why do u think i need timer even for MPI?