- Joined
- Aug 11, 2009
- Messages
- 605
I am trying to learn to make MUI spells and followed a guide (which made another spell than this, but I thought it might work about the same). Here is some info:
Spell Description:
The Mountain King slams the ground three times, damaging all nearby enemies every 0.5 sec.
Error:
It works the first cast, but second cast he only slams one time.
Code Init:
Edit: Sorry I saw now i didnt reset the MS_Count variable >.< this is Solved!
Spell Description:
The Mountain King slams the ground three times, damaging all nearby enemies every 0.5 sec.
Error:
It works the first cast, but second cast he only slams one time.
Code Init:
-
Spell 3 Multi Slam Init
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Multi Slam (Melee)
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MS_Index Equal to 0
-
Then - Actions
- Trigger - Turn on Spell 3 Multi Slam Loop <gen>
- Else - Actions
-
If - Conditions
- Set MS_MUI = (MS_MUI + 1)
- Set MS_Index = (MS_Index + 1)
- Set MS_TurnOn[MS_MUI] = True
- Set MS_Damage[MS_MUI] = ((1.00 x (Real((Hero level of (Triggering unit))))) + (0.30 x (Real((Agility of (Triggering unit) (Include bonuses))))))
- Set MS_Caster[MS_MUI] = (Triggering unit)
- Animation - Change MS_Caster[MS_MUI]'s animation speed to 200.00% of its original speed
- Animation - Play MS_Caster[MS_MUI]'s attack slam animation
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Spell 3 Multi Slam Loop
-
Events
- Time - Every 0.50 seconds of game time
- Conditions
-
Actions
-
For each (Integer MS_Loop) from 1 to MS_MUI, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MS_TurnOn[MS_Loop] Equal to True
-
Then - Actions
- Special Effect - Create a special effect attached to the origin of MS_Caster[MS_Loop] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
- Set UnitGroup[MS_Loop] = (Units within 300.00 of (Position of MS_Caster[MS_Loop]) matching (((Matching unit) belongs to an enemy of (Owner of MS_Caster[MS_Loop])) Equal to True))
-
Unit Group - Pick every unit in UnitGroup[MS_Loop] and do (Actions)
-
Loop - Actions
- Unit - Cause MS_Caster[MS_Loop] to damage (Picked unit), dealing MS_Damage[MS_Loop] damage of attack type Normal and damage type Normal
-
Loop - Actions
- Custom script: call DestroyGroup (udg_UnitGroup[MS_Loop])
- Set MS_Count[MS_Loop] = (MS_Count[MS_Loop] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MS_Count[MS_Loop] Less than 3
-
Then - Actions
- Animation - Play MS_Caster[MS_Loop]'s attack slam animation
-
Else - Actions
- Set MS_Index = (MS_Index - 1)
- Animation - Change MS_Caster[MS_Loop]'s animation speed to 100.00% of its original speed
- Animation - Reset MS_Caster[MS_Loop]'s animation
- Set MS_Caster[MS_Loop] = No unit
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MS_Index Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Set MS_MUI = 0
- Set MS_Loop = 0
- Else - Actions
-
If - Conditions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer MS_Loop) from 1 to MS_MUI, do (Actions)
-
Events
Edit: Sorry I saw now i didnt reset the MS_Count variable >.< this is Solved!