Moderator
M
Moderator
11:14, 15th Jun 2010
Hanky:
The spell is just to simple. Everyone could do that in 2 minutes or less.
Hanky:
The spell is just to simple. Everyone could do that in 2 minutes or less.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
(0 ratings)
Approved
Arcane Blast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Arcane Blast

Actions


Set ABCaster = (Triggering unit)


Set ABCastPoint = (Position of Caster)


Set ABGroup = (Units within 450.00 of ABCastPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of ABCaster)) Equal to True))))


Unit Group - Pick every unit in ABGroup and do (Actions)



Loop - Actions




Set ABPicked = (Position of (Picked unit))




Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of ABCaster) at Unit_Loc facing Default building facing degrees




Set ABDummy[1] = (Last created unit)




Unit - Add a 3.00 second Generic expiration timer to ABDummy[1]




Animation - Change ABDummy[1]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 20.00% transparency




Unit - Add Arcane Blast (Ethereal Copy) to ABDummy[1]




Unit - Set level of Arcane Blast (Ethereal Copy) for ABDummy[1] to (Level of Arcane Blast for Caster)




Custom script: call RemoveLocation (udg_ABPicked)


Custom script: set udg_ABCaster = null


Custom script: call RemoveLocation (udg_ABCastPoint)


Custom script: call DestroyGroup (udg_ABGroup)
Arcane Blast

Events


Unit - A unit start the launch of an ability

Conditions


(Ability being cast) Uguale a Arcane Blast

Actions


Set Caster = (Casting unit)


Wait 0.50 seconds
Unit Group - Pick every unit in (Units within 450.00 of (Position of Caster)) and do (Actions)

Loop - Actions


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



If - Conditions




((Picked unit) has buff Arcane Blast ) Uguale a TRUE




((Picked unit) is Un eroe) Uguale a FALSE




((Picked unit) is Una struttura) Uguale a FALSE



Allora - Azioni




Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of Caster) at (Position of (Picked unit)) facing (Facing of (Picked unit)) degrees




Unit - There are many actions below but they doesn't leak...
Arcane Blast

Events


Unit - A unit ends the launch of an ability

Conditions


(Ability being cast) Uguale a Arcane Blast

Actions


Set Caster = (Casting unit)


Set Point = (Position of Caster)


Set Group = (Units within 450.00 of Point)


Unit Group - Pick every unit in Group and do (Actions)



Loop - Actions




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





If - Conditions






((Picked unit) has buff Arcane Blast ) Uguale a TRUE






((Picked unit) is Un eroe) Uguale a FALSE






((Picked unit) is Una struttura) Uguale a FALSE





Then - Actions






Set Point2 = (Position of (Picked Unit))






Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of Caster) at Point2 facing (Facing of (Picked unit)) degrees






Custom script: call RemoveLocation(udg_Point2)


Custom script: call RemoveLocation(udg_Point)


Custom script: call DestroyGroup(udg_Group)
Set Caster = (Casting unit)
Wait 0.50 seconds
Unit Group - Pick every unit in (Units within 450.00 of (Position of Caster)) and do (Actions)

Loop - Actions


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



If - Conditions




((Picked unit) has buff Arcane Blast ) Equal to True




((Picked unit) is A Hero) Equal to False




((Picked unit) is A structure) Equal to False



Then - Actions




Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of Caster) at (Position of (Picked unit)) facing (Facing of (Picked unit)) degrees




Set EtherealCopy[1] = (Last created unit)




Unit - Add a 3.00 second Generic expiration timer to EtherealCopy[1]




Animation - Change EtherealCopy[1]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 20.00% transparency




Unit - Add Arcane Blast (Ethereal Copy) to EtherealCopy[1]




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





If - Conditions






(Level of Arcane Blast for Caster) Equal to 2





Then - Actions






Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to 2





Else - Actions






Do nothing




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





If - Conditions






(Level of Arcane Blast for Caster) Equal to 3





Then - Actions






Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to 3





Else - Actions






Do nothing



Else - Actions




Do nothing
Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of Caster) at (Position of (Picked unit)) facing (Facing of (Picked unit)) degrees
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions


(Level of Arcane Blast for Caster) Equal to 2

Then - Actions


Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to 2

Else - Actions


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

If - Conditions


(Level of Arcane Blast for Caster) Equal to 3

Then - Actions


Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to 3

Else - Actions


Do nothing
Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to (Level of Arcane Blast for Caster)
Arcane Blast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Arcane Blast

Actions


Set Caster = (Triggering unit)


Set Eth_Location = (Position of Caster)


Set Ethernal_Group = (Units within 450.00 of Eth_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True))))


Unit Group - Pick every unit in Ethernal_Group and do (Actions)



Loop - Actions




Set Unit_Loc = (Position of (Picked unit))




Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of Caster) at Unit_Loc facing Default building facing degrees




Set EtherealCopy[1] = (Last created unit)




Unit - Add a 3.00 second Generic expiration timer to EtherealCopy[1]




Animation - Change EtherealCopy[1]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 20.00% transparency




Unit - Add Arcane Blast (Ethereal Copy) to EtherealCopy[1]




Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to (Level of Arcane Blast for Caster)




Custom script: call RemoveLocation (udg_Unit_Loc)


Custom script: set udg_Caster = null


Custom script: call RemoveLocation (udg_Eth_Location)


Custom script: call DestroyGroup (udg_Ethernal_Group)
Custom script: set udg_EtherealCopy = null
Use triggering unit
Set Caster = (Casting unit)
Remove this
Wait 0.50 seconds
This leaks a location, group
Unit Group - Pick every unit in (Units within 450.00 of (Position of Caster)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff Arcane Blast ) Equal to True
((Picked unit) is A Hero) Equal to False
((Picked unit) is A structure) Equal to False
Then - Actions
Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of Caster) at (Position of (Picked unit)) facing (Facing of (Picked unit)) degrees
Set EtherealCopy[1] = (Last created unit)
Unit - Add a 3.00 second Generic expiration timer to EtherealCopy[1]
Animation - Change EtherealCopy[1]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 20.00% transparency
Unit - Add Arcane Blast (Ethereal Copy) to EtherealCopy[1]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Arcane Blast for Caster) Equal to 2
Then - Actions
Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to 2
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Arcane Blast for Caster) Equal to 3
Then - Actions
Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to 3
Else - Actions
Do nothing
Else - Actions
Do nothing
This leaks 2 locations
Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of Caster) at (Position of (Picked unit)) facing (Facing of (Picked unit)) degrees
Never add this line anywhere, it only slows down the trigger
Do nothing
This
And this
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Arcane Blast for Caster) Equal to 2
Then - Actions
Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to 2
Else - Actions
Do nothing
Can be changed with
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Arcane Blast for Caster) Equal to 3
Then - Actions
Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to 3
Else - Actions
Do nothing
Thus preventing multi usage of IF/THEN/ELSE
Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to (Level of Arcane Blast for Caster)
At the end, your trigger must look like this:
Arcane Blast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Arcane Blast
Actions
Set Caster = (Triggering unit)
Set Eth_Location = (Position of Caster)
Set Ethernal_Group = (Units within 450.00 of Eth_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True))))
Unit Group - Pick every unit in Ethernal_Group and do (Actions)
Loop - Actions
Set Unit_Loc = (Position of (Picked unit))
Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of Caster) at Unit_Loc facing Default building facing degrees
Set EtherealCopy[1] = (Last created unit)
Unit - Add a 3.00 second Generic expiration timer to EtherealCopy[1]
Animation - Change EtherealCopy[1]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 20.00% transparency
Unit - Add Arcane Blast (Ethereal Copy) to EtherealCopy[1]
Unit - Set level of Arcane Blast (Ethereal Copy) for EtherealCopy[1] to (Level of Arcane Blast for Caster)
Custom script: call RemoveLocation (udg_Unit_Loc)
Custom script: set udg_Caster = null
Custom script: call RemoveLocation (udg_Eth_Location)
Custom script: call DestroyGroup (udg_Ethernal_Group)
Other things, fix discription, fix your typos, and add documentation with "Trigger Comments" showing what the trigger actually does.
Also I forgot to mention, you don't need an array veriable for the "EtherealCopy" unit, and also add this after the "Custom script: call RemoveLocation (udg_Unit_Loc)"
Custom script: set udg_EtherealCopy = null
Set ABCaster = (Triggering unit)
Custom script: set udg_ABDummy[1] = null
mortar I thought that you didnt need to null unit variables as they overwrite themselves without leaking?
mortar I thought that you didnt need to null unit variables as they overwrite themselves without leaking?
Arcane Blast

Events


Unit - A unit Begins casting an ability
Arcane Blast

Events


Unit - A unit Starts the effect of an ability
In the end of the loop you'll still have 1 unit left.
Yes actually, you don't need to null them, but its not a mistake. Just to keep memory free.
Memory? No, we only null variables because Warcraft's handle counter doesn't decrease automaticly.
set udg_ABCaster = null
set udg_ABCastPoint = null
set udg_ABGroup = null
Using imported models is never a good thing in spells.
Using imported models is never a good thing in spells.
The special effects can be removed, will not alter the functioning of the ability... -.-"
