• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Freeze Spell

Status
Not open for further replies.
Level 3
Joined
Feb 20, 2008
Messages
54
So the idea is like this, a unit casts breath of frost and the units that are damaged by it will be freezed for 0.5 seconnds, the only problem is that they won't defreeze(I mean unpause)...
  • Events
  • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
  • Unit Group - Pick every unit in (Units in Rect 012 <gen>) and do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then actions) else do (Else Actions)
  • If - conditions
  • ((Picked unit) has buff Breath of Frost(freeze)) equal to True
  • Then - Actions
  • Unit - Remove Breath of Frost (freeze) buff from (Picked Unit)
  • Unit - Pause (Picked Unit)
  • Advanced - Create Attach Point - Overhead of (Picked Unit) the Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl effect lasting 0.50 seconds
  • Wait 0.50 seconds
  • Unit - Unpause (Picked Unit)
What's the problem?
 
Level 3
Joined
Feb 20, 2008
Messages
54
Damn, but if so I need variable type array and I don't know how to use them, if you could please show me an example...
 
Level 5
Joined
May 21, 2006
Messages
174
When in the trigger editor press Ctrl+B to bring up the variable editor.
Add a new variable with the name FreezeGroup and type "Unit Group".

  • Events
  • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
  • Unit Group - Pick every unit in (Units in Rect 012 <gen>) and do (Actions)
  • Loop - Actions
  • -------- Added this: --------
  • Unit Group - Add (Picked unit) to FreezeGroup
  • If (All Conditions are True) then do (Then actions) else do (Else Actions)
  • If - conditions
  • ((Picked unit) has buff Breath of Frost(freeze)) equal to True
  • Then - Actions
  • Unit - Remove Breath of Frost (freeze) buff from (Picked Unit)
  • Unit - Pause (Picked Unit)
  • Advanced - Create Attach Point - Overhead of (Picked Unit) the Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl effect lasting 0.50 seconds
  • Wait 0.50 seconds
  • Unit - Unpause (Picked Unit)
  • -------- Added this: --------
  • Unit Group - Remove all units from FreezeGroup
Notice the "Unit Groups", though this is a so called Global Variable and will only work properly as long as multiple heroes aren't casting the spell at the same time.

And btw, it "leaks". Probably does not matter in this case anyway.
 
  • Events
  • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
  • set local unit u = Unit
  • set Unit = Picked unit
  • Unit Group - Pick every unit in (Units in Rect 012 <gen>) and do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then actions) else do (Else Actions)
  • If - conditions
  • ((Unit) has buff Breath of Frost(freeze)) equal to True
  • Then - Actions
  • Unit - Remove Breath of Frost (freeze) buff from (Unit)
  • Unit - Pause (Unit)
  • Special Effect - Overhead of (Unit) the Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
  • Special Effect - Destroy (Last created) Special effect
  • Wait Gametime - 0.50 seconds
  • Unit - Unpause (Unit)
  • set u = null
I think it should be something like this, but correct me if i'm wrong by setting "Unit" I'm not sure what is first local or global...
And btw. you are leaking a location there.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
Why not just create a periodic trigger that checks every .1 second for any units with a buff (make a Breath of Frost buff, it is just for checking) and create a dummy unit and order it to cast some stun spell on the unit.

That's like 10x more complicated then just casting a 100% slow spell with frost buff? xD
Cmon, stop being complicated!!!! o_O
 
Level 3
Joined
Feb 20, 2008
Messages
54
I had to make another trigger to make the unpause work, because it still didn't work in the end but all that counts is that in the end I managed to get it working the only problem is that the special effect lasts too much...
 
Level 7
Joined
Jul 20, 2008
Messages
377
Why are you guys being so complicated?
Btw, avoid waits in custom spells it can bug.

Just create a dummy for each unit that got hit (loop it?) add slow with 10o% to it. And set duration of that slow to 0.5 seconds. Voala.

This.

Ockham's Razor applies.
 
Status
Not open for further replies.
Top