| 01-10-2004, 01:37 PM | #1 |
I'm working on an area of effect spell (Confusion) which will cause a random amount of dizziness on units in an area (MK's clap, but with a variable amount of slow). So far, I've only gotten partial luck with it. My trigger looks like it should work properly - add a 1 radius aura ability to effected unit(s) to indicate that it is slowed, and then manually Set Movement Speed of unit by a random percentage - after a delay, remove the ability aura and reset movement speed. My problem? It only seems to add the ability to units randomly... for some ungodly reason, if I stomp my Confusion spell in a pack of 10 enemies, only 2 or 3 will be given the ability and slowed (there are other problems, but that is my biggest pain right now). Here's the text I'm using in my trigger - a bit on the long side, but I couldn't think of any other way to do this :). Basically, the thunderclap fires and puts a buff on the target - that buff lasts 1 second less than my trigger, so that enemies who were Confused can run out of the radius of the triggering unit and not be perma-slowed. Hopefuly someone can help me out here - if any more clarity is needed, let me know! :) Code:
PLODDER Confusion
Events
Unit - A unit Is issued an order with no target
Conditions
(Unit-type of (Triggering unit)) Equal to Plodder
(Issued order) Equal to (Order(thunderclap))
Actions
Unit Group - Pick every unit in (Units in (Region centered at (Position of (Triggering unit)) with size (400.00, 400.00))) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Not equal to (Owner of (Picked unit))
((Picked unit) is A Hero) Not equal to True
((Picked unit) is A ground unit) Equal to True
Then - Actions
Game - Display to (All players) the text: ADDING BUFF
Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) x (Random real number between 0.50 and 0.75))
Unit - Add Confused (EFFECT) to (Picked unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Not equal to (Owner of (Picked unit))
((Picked unit) is A ground unit) Equal to True
((Picked unit) is A Hero) Equal to True
Then - Actions
Game - Display to (All players) the text: ADDING BUFF
Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) x (Random real number between 0.01 and 0.10))
Unit - Add Confused (EFFECT) to (Picked unit)
Else - Actions
Wait (12.00 x (Real(ConfusionLevel[(Player number of (Owner of (Triggering unit)))]))) seconds
Game - Display to (All players) for 10.00 seconds the text: DONE
Unit Group - Pick every unit in (Units in (Entire map)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has buff Confused ) Equal to True
((Triggering unit) has buff Initial Confusion ) Not equal to True
Then - Actions
Game - Display to (All players) for 30.00 seconds the text: (UNIT REMOVING BUFF: + ((Name of (Picked unit)) + ( OLD MOVE SPEED: + (String((Current movement speed of (Picked unit)))))))
Unit - Remove Confused (EFFECT) from (Triggering unit)
Unit - Remove Confused buff from (Triggering unit)
Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
Game - Display to (All players) for 30.00 seconds the text: (String((Current movement speed of (Picked unit))))
Else - Actions |
