I tried to make a MUI code based on a tutorial. It gives the unit 4 defense and 8 attack damage.Code below:
-
Lightning Call
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Lightning Call
-
Actions
- -------- Here, I set the main index and this is required for later. --------
- Set IndexLimit = (IndexLimit + 1)
- -------- Now I set the other 3 variables. These require the IndexLimit specified above. --------
- Set TpUnit[IndexLimit] = (Triggering unit)
- Set AffUnit[IndexLimit] = (Target unit of ability being cast)
- Set Numbering[IndexLimit] = 0
- -------- The 3 variables are set. Now it's time for the spell to work. But first: --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- IndexLimit Equal to 1
-
Then - Actions
- Trigger - Turn on Lightning Call Looping <gen>
- Else - Actions
-
If - Conditions
-
Events
-
Lightning Call Looping
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
For each (Integer IndexCurrent) from 1 to IndexLimit, do (Actions)
-
Loop - Actions
- Set Numbering[IndexCurrent] = (Numbering[IndexCurrent] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Numbering[IndexCurrent] Equal to 2
-
Then - Actions
- Unit - Add Lightning Activation to AffUnit[IndexCurrent]
- Set TpUnit[IndexCurrent] = TpUnit[IndexLimit]
- Set AffUnit[IndexCurrent] = AffUnit[IndexLimit]
- Set Numbering[IndexCurrent] = Numbering[IndexLimit]
- Set IndexLimit = (IndexLimit - 1)
- Set IndexCurrent = (IndexCurrent - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- IndexLimit Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
For each (Integer IndexCurrent) from 1 to IndexLimit, do (Actions)
-
Events