• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] What could be causeing the problem...?

Status
Not open for further replies.
The problem being that this spell makes massive lag it seems, and I want to find out how to fix it.

[trigger=Activator]
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to SUPER SLASH

Actions
Floating Text - Create floating text that reads SUPERRRRRR......... above (Triggering unit) with Z offset 0.00, using font size 20.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Set superslashtxt[(Player number of (Owner of (Triggering unit)))] = (Last created floating text)
Wait 0.50 game-time seconds
Floating Text - Destroy superslashtxt[(Player number of (Owner of (Triggering unit)))]
Floating Text - Create floating text that reads SLASH!!!!!!!!!!!!!!... above (Triggering unit) with Z offset 0.00, using font size 20.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Set superslashtxt[(Player number of (Owner of (Triggering unit)))] = (Last created floating text)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GetsugaTenshou_LoopIndex[1] Equal to 0
Then - Actions
Trigger - Turn on Getsuga Tenshou Loop <gen>
Else - Actions
Set GetsugaTenshou_LoopIndex[1] = (GetsugaTenshou_LoopIndex[1] + 1)
Set GetsugaTenshou_LoopIndex[2] = (GetsugaTenshou_LoopIndex[2] + 1)
-------- ----------------------------------------------------------------------------------------------- --------
Set GetsugaTenshou_Caster[GetsugaTenshou_LoopIndex[2]] = (Triggering unit)
Set GetsugaTenshou_LeakPoint[0] = (Position of GetsugaTenshou_Caster[GetsugaTenshou_LoopIndex[2]])
Set GetsugaTenshou_LeakPoint[1] = (Target point of ability being cast)
Set GetsugaTenshou_Angle[GetsugaTenshou_LoopIndex[2]] = (Angle from GetsugaTenshou_LeakPoint[0] to GetsugaTenshou_LeakPoint[1])
Set GetsugaTenshou_LeakPoint[2] = (GetsugaTenshou_LeakPoint[0] offset by 50.00 towards GetsugaTenshou_Angle[GetsugaTenshou_LoopIndex[2]] degrees)
Set GetsugaTenshou_Speed[GetsugaTenshou_LoopIndex[2]] = 50.00
Set GetsugaTenshou_MaxDistance[GetsugaTenshou_LoopIndex[2]] = 1000.00
Set GetsugaTenshou_CurDistance[GetsugaTenshou_LoopIndex[2]] = 0.00
Set GetsugaTenshou_Active[GetsugaTenshou_LoopIndex[2]] = True
Set GetsugaTenshou_Damage[GetsugaTenshou_LoopIndex[2]] = (100.00 x (Real((Intelligence of GetsugaTenshou_Caster[GetsugaTenshou_LoopIndex[2]] (Include bonuses)))))
Unit - Create 1 Getsuga Tensho Dummy for (Owner of GetsugaTenshou_Caster[GetsugaTenshou_LoopIndex[2]]) at GetsugaTenshou_LeakPoint[0] facing GetsugaTenshou_Angle[GetsugaTenshou_LoopIndex[2]] degrees
Unit Group - Add (Last created unit) to sfxgroup
Set GetsugaTenshou_Dummy[GetsugaTenshou_LoopIndex[2]] = (Last created unit)
Custom script: set udg_GetsugaTenshou_DamagedUnits[udg_GetsugaTenshou_LoopIndex[2]] = CreateGroup()
Custom script: call RemoveLocation (udg_GetsugaTenshou_LeakPoint[0])
Custom script: call RemoveLocation (udg_GetsugaTenshou_LeakPoint[1])
Custom script: call RemoveLocation (udg_GetsugaTenshou_LeakPoint[2])
Wait 0.45 game-time seconds
Floating Text - Destroy superslashtxt[(Player number of (Owner of (Triggering unit)))]
[/trigger]
[trigger=Main Loop]
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
-------- DON'T CHANGE SOMETHING BELOW THIS LINE! --------
-------- --------------------------------------------------------------------------------------------------------------------- --------
For each (Integer GetsugaTenshou_LoopIndex[3]) from 1 to GetsugaTenshou_LoopIndex[2], do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GetsugaTenshou_Active[GetsugaTenshou_LoopIndex[3]] Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GetsugaTenshou_CurDistance[GetsugaTenshou_LoopIndex[3]] Less than GetsugaTenshou_MaxDistance[GetsugaTenshou_LoopIndex[3]]
Then - Actions
Set GetsugaTenshou_LeakPoint[0] = (Position of GetsugaTenshou_Dummy[GetsugaTenshou_LoopIndex[3]])
Set GetsugaTenshou_LeakPoint[1] = (GetsugaTenshou_LeakPoint[0] offset by GetsugaTenshou_Speed[GetsugaTenshou_LoopIndex[3]] towards GetsugaTenshou_Angle[GetsugaTenshou_LoopIndex[3]] degrees)
Special Effect - Create a special effect at GetsugaTenshou_LeakPoint[1] using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
Special Effect - Destroy (Last created special effect)
Unit - Move GetsugaTenshou_Dummy[GetsugaTenshou_LoopIndex[3]] instantly to GetsugaTenshou_LeakPoint[1], facing GetsugaTenshou_Angle[GetsugaTenshou_LoopIndex[3]] degrees
Set GetsugaTenshou_CurDistance[GetsugaTenshou_LoopIndex[3]] = (GetsugaTenshou_CurDistance[GetsugaTenshou_LoopIndex[3]] + GetsugaTenshou_Speed[GetsugaTenshou_LoopIndex[3]])
Set GetsugaTenshou_TempGroup = (Units within 200.00 of GetsugaTenshou_LeakPoint[1] matching ((((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of GetsugaTenshou_Caster[GetsugaTenshou_LoopIndex[3]])) Equal to False)) and (((Matching unit) is in
Unit Group - Pick every unit in GetsugaTenshou_TempGroup and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to GetsugaTenshou_DamagedUnits[GetsugaTenshou_LoopIndex[3]]
Unit - Cause GetsugaTenshou_Caster[GetsugaTenshou_LoopIndex[3]] to damage (Picked unit), dealing GetsugaTenshou_Damage[GetsugaTenshou_LoopIndex[3]] damage of attack type Spells and damage type Normal
Custom script: call DestroyGroup (udg_GetsugaTenshou_TempGroup)
Custom script: call RemoveLocation(udg_GetsugaTenshou_LeakPoint[0])
Custom script: call RemoveLocation(udg_GetsugaTenshou_LeakPoint[1])
Else - Actions
Unit - Add a 0.01 second Generic expiration timer to GetsugaTenshou_Dummy[GetsugaTenshou_LoopIndex[3]]
Unit - Make GetsugaTenshou_Dummy[GetsugaTenshou_LoopIndex[3]] Explode on death
Unit Group - Remove GetsugaTenshou_Dummy[GetsugaTenshou_LoopIndex[3]] from sfxgroup
Set GetsugaTenshou_LoopIndex[1] = (GetsugaTenshou_LoopIndex[1] - 1)
Set GetsugaTenshou_Active[GetsugaTenshou_LoopIndex[3]] = False
Custom script: call DestroyGroup (udg_GetsugaTenshou_DamagedUnits[udg_GetsugaTenshou_LoopIndex[3]])
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GetsugaTenshou_LoopIndex[1] Equal to 0
Then - Actions
Set GetsugaTenshou_LoopIndex[2] = 0
Trigger - Turn off (This trigger)
Else - Actions

[/trigger]

[trigger=Extra SFX Loop]
Events
Time - Every 0.30 seconds of game time
Conditions
(Number of units in sfxgroup) Greater than 0
Actions
Unit Group - Pick every unit in sfxgroup and do (Actions)
Loop - Actions
Set pone = (Position of (Picked unit))
Special Effect - Create a special effect at pone using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at pone using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_pone)

[/trigger]


Thank you for taking your time to read this.
 
Last edited:
Status
Not open for further replies.
Top