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.
(0 ratings)
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
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?
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... -.-"