- Joined
- Feb 3, 2008
- Messages
- 106
Please someone help me! I am new to MUI, and I made this spell and it works but when I cast it there is a huge volume of lagg. Please tell me what is wrong with it 
And the loop code goes

-
Fireball Cast
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Fireball Modified
-
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




BB_Skip Equal to 0
-
-



Then - Actions
-




Trigger - Turn on Fireball Loop <gen>
-
-



Else - Actions
-
-


Set BB_Times = (BB_Times + 1)
-


Set BB_Skip = (BB_Skip + 1)
-


Set BB_Off[BB_Times] = True
-


Set BB_CasterUnit[BB_Times] = (Casting unit)
-


Set BB_Point[0] = (Position of BB_CasterUnit[BB_Times])
-


Set BB_Point[1] = (Target point of ability being cast)
-


Set BB_Distance[BB_Times] = 800.00
-


Set BB_Angle[BB_Times] = (Angle from BB_Point[0] to BB_Point[1])
-


Set BB_Speed[BB_Times] = 15.00
-


Set BB_Spam[BB_Times] = 0
-


Set BB_Equation = ((Level of Fireball Modified for BB_CasterUnit[BB_Times]) x 100)
-


Unit - Create 1 Fireball Dummy for (Owner of BB_CasterUnit[BB_Times]) at BB_Point[0] facing BB_Angle[BB_Times] degrees
-


Set BB_Dummy[BB_Times] = (Last created unit)
-


Custom script: call RemoveLocation(udg_BB_Point [0])
-


Custom script: call RemoveLocation(udg_BB_Point [1])
-
-
And the loop code goes
-
Fireball Loop
-

Events
-


Time - Every 0.02 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer BB) from 1 to BB, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






BB_Off[BB] Equal to True
-
-





Then - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








BB_Distance[BB] Less than or equal to 0.00
-
-







Then - Actions
-








Set BB_Point[2] = (Position of BB_Dummy[BB])
-








Set BB_Skip = (BB_Skip - 1)
-








Set BB_Off[BB] = False
-








Special Effect - Create a special effect at BB_Point[2] using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
-








Special Effect - Destroy (Last created special effect)
-








Unit - Remove BB_Dummy[BB] from the game
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










BB_Skip Equal to 0
-
-









Then - Actions
-










Set BB_Times = 0
-










Trigger - Turn off Fireball Loop <gen>
-
-









Else - Actions
-
-
-







Else - Actions
-








Set BB_Distance[BB] = (BB_Distance[BB] - BB_Speed[BB])
-








Set BB_Point[3] = (Position of BB_Dummy[BB])
-








Set BB_Point[4] = (BB_Point[3] offset by BB_Speed[BB] towards BB_Angle[BB] degrees)
-








Unit - Move BB_Dummy[BB] instantly to BB_Point[4]
-








Set BB_ExGroup[BB] = (Units within 70.00 of BB_Point[4] matching ((((Matching unit) belongs to an ally of (Owner of BB_Dummy[BB])) Not equal to True) and (((Matching unit) is dead) Not equal to True)))
-








Unit Group - Pick every unit in BB_ExGroup[BB] and do (Actions)
-









Loop - Actions
-










Set BB_ExUnit[BB] = (Picked unit)
-










Unit - Cause BB_CasterUnit[BB] to damage BB_ExUnit[BB], dealing (Real(BB_Equation)) damage of attack type Hero and damage type Normal
-










Set BB_Distance[BB] = 0.00
-
-
-








Destructible - Pick every destructible within 200.00 of BB_Point[4] and do (Actions)
-









Loop - Actions
-










Set BB_Distance[BB] = 0.00
-
-
-








Custom script: call RemoveLocation(udg_BB_Point [2])
-








Custom script: call RemoveLocation(udg_BB_Point [3])
-








Custom script: call RemoveLocation(udg_BB_Point [4])
-








Custom script: call DestroyGroup(udg_BB_ExGroup[udg_BB])
-
-
-
-





Else - Actions
-
-
-
-
-
Last edited:



