T
Tom_Green
Guest
Hello again. I have a spell here that I made for a water-elemental based hero. Plz take a look-see at it n tell me what you think of it. If you have any spell ideas for him, you can tell me those too X)
Spell
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Hydro
Actions
Wait 0.50 seconds
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is dead) Equal to False
Then - Actions
Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
Wait 1.00 seconds
Animation - Reset (Casting unit)'s animation
Darthfett said:Hey. I like the spell, and hero so much, I decided to add another spell to your hero. The only problem was that they both had the same order strings, so I turned off your spell's trigger, so you could see mine. (Sry its a bit laggy)
It's a wave-like spell, probably something like vex would make, only in GUI.
Spell Copy
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Hydro
Actions
Wait 0.50 seconds
Set TempPoint = (Position of (Casting unit))
Set TempGroup = (Units within 500.00 of TempPoint)
Set NagaDeathIndex = 0
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
Set NagaDeath[NagaDeathIndex] = (Last created special effect)
Set NagaDeathIndex = (NagaDeathIndex + 1)
Wait 1.00 seconds
Animation - Reset (Casting unit)'s animation
Special Effect - Destroy NagaDeath[NagaDeathIndex]
Set NagaDeathIndex = 0
For each (Integer A) from 1 to (Number of units in TempGroup), do (Actions)
Loop - Actions
Special Effect - Destroy NagaDeath[NagaDeathIndex]
Set NagaDeathIndex = (NagaDeathIndex + 1)
Custom script: call DestroyGroup( udg_TempGroup )
Custom script: call RemoveLocation( udg_TempPoint )
Grurf said:@Peng:
There are 3 things that leak: Unit Group, Player Group and Points (Locations, Positions). Leaking means that after using it, the data just stays in memory and cannot be destroyed until you quit the map. You can prevent this by setting a variable to the data, use that variable in the actions and then destroy it, using either custom scripts or the functions of WEU/UMSWE (or JASS, of course).
UnknowVector said:EDIT: Argh Korolen Posted before me... well whatever sorry i ate before hitting "Reply"
Deffently a desent spell, i good see it in a hero arena or a hero D or something like that. I like it.
Hmmm heres a memory leak free version of your trigger.
you need
Name ........................Type
NagaDeath.....................SFX Array of size <However many untis can be hit by spell, btw 500 holds alot of units>
NagaDeathIndex.................Integer
TempPoint..................Point
TempGroup..................Unit Group
Code:Spell Copy Events Unit - A unit Begins casting an ability Conditions (Ability being cast) Equal to Hydro Actions Wait 0.50 seconds Set TempPoint = (Position of (Casting unit)) Set TempGroup = (Units within 500.00 of TempPoint) Set NagaDeathIndex = 0 Unit Group - Pick every unit in TempGroup and do (Actions) Loop - Actions Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl Set NagaDeath[NagaDeathIndex] = (Last created special effect) Set NagaDeathIndex = (NagaDeathIndex + 1) Wait 1.00 seconds Animation - Reset (Casting unit)'s animation Special Effect - Destroy NagaDeath[NagaDeathIndex] Set NagaDeathIndex = 0 For each (Integer A) from 1 to (Number of units in TempGroup), do (Actions) Loop - Actions Special Effect - Destroy NagaDeath[NagaDeathIndex] Set NagaDeathIndex = (NagaDeathIndex + 1) Custom script: call DestroyGroup( udg_TempGroup ) Custom script: call RemoveLocation( udg_TempPoint )
Lol dont know why i did that i was bored i guess, and memory leaks insult me when i see them. (Not the person who made the trigger the leak itself)