- Joined
- Oct 2, 2013
- Messages
- 95
I made this spell where the user selects a target point and his hero throws a boomerang ( glaive ) at that point and, upon reaching its destination, the boomerang returns to its owner. All targets hit take damage and are poisoned. Also, if the caster uses silence when the blade is out flying, the blade will go to that target location before returning to it's owner.
Problem is, when I cast it and the glaive hits a unit, the game starts freezing really bad. My computer is very good and it's surely not the problem. Other spells with the same trigger idea ( dummy projectile, scan nearby units to deal damage ) do not cause such lag, even ones who use 5 projectiles. This one uses only one dummy + the temporary ones to poison enemies hit by the glaive.
Anyway, here are the triggers. I use an Indexing method to make it MUI.
Problem is, when I cast it and the glaive hits a unit, the game starts freezing really bad. My computer is very good and it's surely not the problem. Other spells with the same trigger idea ( dummy projectile, scan nearby units to deal damage ) do not cause such lag, even ones who use 5 projectiles. This one uses only one dummy + the temporary ones to poison enemies hit by the glaive.
Anyway, here are the triggers. I use an Indexing method to make it MUI.
-
VorpalBladeAct
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Vorpal Blade
-
-
Actions
-
Set VorpalBlade_Index = (VorpalBlade_Index + 1)
-
Set VorpalBlade_HasEnd[VorpalBlade_Index] = False
-
Set VorpalBlade_HasRelocate[VorpalBlade_Index] = False
-
Set VorpalBlade_Caster[VorpalBlade_Index] = (Triggering unit)
-
Set VorpalBlade_TargetPoint = (Target point of ability being cast)
-
Set VorpalBlade_CasterPoint = (Position of VorpalBlade_Caster[VorpalBlade_Index])
-
Set VorpalBlade_Level[VorpalBlade_Index] = (Level of Vorpal Blade for VorpalBlade_Caster[VorpalBlade_Index])
-
Unit - Create 1 Dummy for (Owner of VorpalBlade_Caster[VorpalBlade_Index]) at VorpalBlade_TargetPoint facing Default building facing degrees
-
Set VorpalBlade_TargetUnit[VorpalBlade_Index] = (Last created unit)
-
Unit - Create 1 VorpalBlade for (Owner of VorpalBlade_Caster[VorpalBlade_Index]) at VorpalBlade_CasterPoint facing VorpalBlade_TargetPoint
-
Set VorpalBlade_FlyBlade[VorpalBlade_Index] = (Last created unit)
-
Unit - Remove Vorpal Blade from VorpalBlade_Caster[VorpalBlade_Index]
-
Unit - Add Vorpal Blade Return to VorpalBlade_Caster[VorpalBlade_Index]
-
Trigger - Turn on VorpalBladeLoop <gen>
-
Trigger - Turn on VorpalBladeDisarm <gen>
-
Custom script: call RemoveLocation(udg_VorpalBlade_TargetPoint)
-
Custom script: call RemoveLocation(udg_VorpalBlade_CasterPoint)
-
-
-
VorpalBladeLoop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer VorpalBlade_LoopInteger) from 1 to VorpalBlade_Index, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
VorpalBlade_HasEnd[VorpalBlade_LoopInteger] Equal to False
-
-
Then - Actions
-
Set VorpalBlade_BladePoint = (Position of VorpalBlade_FlyBlade[VorpalBlade_LoopInteger])
-
Set VorpalBlade_MovePoint = (VorpalBlade_BladePoint offset by 50.00 towards (Facing of VorpalBlade_FlyBlade[VorpalBlade_LoopInteger]) degrees)
-
Set VorpalBlade_EndPoint = (Position of VorpalBlade_TargetUnit[VorpalBlade_LoopInteger])
-
Unit - Move VorpalBlade_FlyBlade[VorpalBlade_LoopInteger] instantly to VorpalBlade_MovePoint
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 200.00 of VorpalBlade_MovePoint matching (((Owner of (Matching unit)) is an ally of (Owner of VorpalBlade_Caster[VorpalBlade_LoopInteger])) Equal to False)) and do (Actions)
-
Loop - Actions
-
Set VorpalBlade_PickedUnit = (Picked unit)
-
Unit - Cause VorpalBlade_Caster[VorpalBlade_LoopInteger] to damage VorpalBlade_PickedUnit, dealing ((Real((Agility of VorpalBlade_Caster[VorpalBlade_LoopInteger] (Include bonuses)))) x (1.00 + (0.25 x (Real(VorpalBlade_Level[VorpalBlade_LoopInteger]))))) damage of attack type Spells and damage type Normal
-
Unit - Create 1 Dummy for (Owner of VorpalBlade_Caster[VorpalBlade_LoopInteger]) at VorpalBlade_BladePoint facing Default building facing degrees
-
Set VorpalBlade_Dummy = (Last created unit)
-
Unit - Add Vorpal Blade [Effect Slow] to VorpalBlade_Dummy
-
Unit - Set level of Vorpal Blade [Effect Slow] for VorpalBlade_Dummy to VorpalBlade_Level[VorpalBlade_LoopInteger]
-
Unit - Order VorpalBlade_Dummy to Night Elf Warden - Shadow Strike VorpalBlade_PickedUnit
-
Unit - Add a 0.50 second Generic expiration timer to VorpalBlade_Dummy
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between VorpalBlade_MovePoint and VorpalBlade_EndPoint) Less than 50.00
-
-
Then - Actions
-
Set VorpalBlade_HasEnd[VorpalBlade_LoopInteger] = True
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_VorpalBlade_BladePoint)
-
Custom script: call RemoveLocation(udg_VorpalBlade_MovePoint)
-
Custom script: call RemoveLocation(udg_VorpalBlade_EndPoint)
-
-
Else - Actions
-
Set VorpalBlade_BladePoint = (Position of VorpalBlade_FlyBlade[VorpalBlade_LoopInteger])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
VorpalBlade_HasRelocate[VorpalBlade_LoopInteger] Equal to True
-
-
Then - Actions
-
Set VorpalBlade_EndPoint = (Position of Silence_TargetUnit[VorpalBlade_LoopInteger])
-
-
Else - Actions
-
Set VorpalBlade_EndPoint = (Position of VorpalBlade_Caster[VorpalBlade_LoopInteger])
-
-
-
Unit - Make VorpalBlade_FlyBlade[VorpalBlade_LoopInteger] face VorpalBlade_EndPoint over 0.00 seconds
-
Set VorpalBlade_MovePoint = (VorpalBlade_BladePoint offset by 50.00 towards (Facing of VorpalBlade_FlyBlade[VorpalBlade_LoopInteger]) degrees)
-
Unit - Move VorpalBlade_FlyBlade[VorpalBlade_LoopInteger] instantly to VorpalBlade_MovePoint
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 200.00 of VorpalBlade_MovePoint matching (((Owner of (Matching unit)) is an ally of (Owner of VorpalBlade_Caster[VorpalBlade_LoopInteger])) Equal to False)) and do (Actions)
-
Loop - Actions
-
Set VorpalBlade_PickedUnit = (Picked unit)
-
Unit - Cause VorpalBlade_Caster[VorpalBlade_LoopInteger] to damage VorpalBlade_PickedUnit, dealing ((Real((Agility of VorpalBlade_Caster[VorpalBlade_LoopInteger] (Include bonuses)))) x (1.00 + (0.25 x (Real(VorpalBlade_Level[VorpalBlade_LoopInteger]))))) damage of attack type Spells and damage type Normal
-
Unit - Create 1 Dummy for (Owner of VorpalBlade_Caster[VorpalBlade_LoopInteger]) at VorpalBlade_BladePoint facing Default building facing degrees
-
Set VorpalBlade_Dummy = (Last created unit)
-
Unit - Add Vorpal Blade [Effect Slow] to VorpalBlade_Dummy
-
Unit - Set level of Vorpal Blade [Effect Slow] for VorpalBlade_Dummy to VorpalBlade_Level[VorpalBlade_LoopInteger]
-
Unit - Order VorpalBlade_Dummy to Night Elf Warden - Shadow Strike VorpalBlade_PickedUnit
-
Unit - Add a 1.50 second Generic expiration timer to VorpalBlade_Dummy
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between VorpalBlade_MovePoint and VorpalBlade_EndPoint) Less than 50.00
-
VorpalBlade_HasRelocate[VorpalBlade_LoopInteger] Equal to True
-
-
Then - Actions
-
Set VorpalBlade_HasRelocate[VorpalBlade_LoopInteger] = False
-
Unit - Kill Silence_TargetUnit[VorpalBlade_LoopInteger]
-
Set VorpalBlade_EndPoint = (Position of VorpalBlade_Caster[VorpalBlade_LoopInteger])
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between VorpalBlade_MovePoint and VorpalBlade_EndPoint) Less than 50.00
-
VorpalBlade_HasRelocate[VorpalBlade_LoopInteger] Equal to False
-
-
Then - Actions
-
Unit - Remove Vorpal Blade Return from VorpalBlade_Caster[VorpalBlade_LoopInteger]
-
Unit - Add Vorpal Blade to VorpalBlade_Caster[VorpalBlade_LoopInteger]
-
Unit - Set level of Vorpal Blade for VorpalBlade_Caster[VorpalBlade_LoopInteger] to VorpalBlade_Level[VorpalBlade_LoopInteger]
-
Set VorpalBlade_Caster[VorpalBlade_LoopInteger] = VorpalBlade_Caster[VorpalBlade_LoopInteger]
-
Set VorpalBlade_HasEnd[VorpalBlade_LoopInteger] = VorpalBlade_HasEnd[VorpalBlade_Index]
-
Set VorpalBlade_HasRelocate[VorpalBlade_LoopInteger] = VorpalBlade_HasRelocate[VorpalBlade_Index]
-
Set VorpalBlade_Level[VorpalBlade_LoopInteger] = VorpalBlade_Level[VorpalBlade_Index]
-
Set Silence_TargetUnit[VorpalBlade_LoopInteger] = Silence_TargetUnit[VorpalBlade_LoopInteger]
-
Unit - Kill VorpalBlade_TargetUnit[VorpalBlade_LoopInteger]
-
Unit - Kill VorpalBlade_FlyBlade[VorpalBlade_LoopInteger]
-
Set VorpalBlade_TargetUnit[VorpalBlade_LoopInteger] = VorpalBlade_TargetUnit[VorpalBlade_Index]
-
Set VorpalBlade_FlyBlade[VorpalBlade_LoopInteger] = VorpalBlade_FlyBlade[VorpalBlade_Index]
-
Set VorpalBlade_Index = (VorpalBlade_Index - 1)
-
Set VorpalBlade_LoopInteger = (VorpalBlade_LoopInteger - 1)
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_VorpalBlade_EndPoint)
-
Custom script: call RemoveLocation(udg_VorpalBlade_BladePoint)
-
Custom script: call RemoveLocation(udg_VorpalBlade_MovePoint)
-
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
VorpalBlade_Index Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
VorpalBladeReturn
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Vorpal Blade Return
-
-
Actions
-
Set VorpalBlade_ReturnCaster = (Triggering unit)
-
For each (Integer VorpalBlade_LoopInteger) from 1 to VorpalBlade_Index, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
VorpalBlade_ReturnCaster Equal to VorpalBlade_Caster[VorpalBlade_LoopInteger]
-
-
Then - Actions
-
Unit - Remove Vorpal Blade Return from VorpalBlade_Caster[VorpalBlade_LoopInteger]
-
Unit - Add Vorpal Blade to VorpalBlade_Caster[VorpalBlade_LoopInteger]
-
Unit - Set level of Vorpal Blade for VorpalBlade_Caster[VorpalBlade_LoopInteger] to VorpalBlade_Level[VorpalBlade_LoopInteger]
-
Set VorpalBlade_Caster[VorpalBlade_LoopInteger] = VorpalBlade_Caster[VorpalBlade_LoopInteger]
-
Set VorpalBlade_HasEnd[VorpalBlade_LoopInteger] = VorpalBlade_HasEnd[VorpalBlade_Index]
-
Set VorpalBlade_HasRelocate[VorpalBlade_LoopInteger] = VorpalBlade_HasRelocate[VorpalBlade_Index]
-
Set VorpalBlade_Level[VorpalBlade_LoopInteger] = VorpalBlade_Level[VorpalBlade_Index]
-
Set Silence_TargetUnit[VorpalBlade_LoopInteger] = Silence_TargetUnit[VorpalBlade_LoopInteger]
-
Unit - Kill VorpalBlade_TargetUnit[VorpalBlade_LoopInteger]
-
Unit - Kill VorpalBlade_FlyBlade[VorpalBlade_LoopInteger]
-
Set VorpalBlade_TargetUnit[VorpalBlade_LoopInteger] = VorpalBlade_TargetUnit[VorpalBlade_Index]
-
Set VorpalBlade_FlyBlade[VorpalBlade_LoopInteger] = VorpalBlade_FlyBlade[VorpalBlade_Index]
-
Set VorpalBlade_Index = (VorpalBlade_Index - 1)
-
Set VorpalBlade_LoopInteger = (VorpalBlade_LoopInteger - 1)
-
-
Else - Actions
-
-
-
-
-