• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[GUI][MUI] Colour Spray v1.5

  • Like
Reactions: Aspard

Colour Spray


This is mostly inspired by the Dungeons and Dragons spell of the same name. I wanted to make something pretty, so here it is.

Description:

Brings forth a cascade of bedazzling lights, disorienting enemy units in a frontward arc. The closer the unit, the longer it will remain stunned.




  • Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Creates the hashtable for effects --------
      • Hashtable - Create a hashtable
      • Set ColSpray_Hash = (Last created hashtable)
      • -------- The number of levels the spell has --------
      • Set ColSpray_Data_Levels = 3
      • -------- The size of the effect's arc, in degrees --------
      • Set ColSpray_Levels_ArcAngle[1] = 90.00
      • Set ColSpray_Levels_ArcAngle[2] = 100.00
      • Set ColSpray_Levels_ArcAngle[3] = 110.00
      • -------- The length the cone extends --------
      • Set ColSpray_Levels_MaxDistance[1] = 250.00
      • Set ColSpray_Levels_MaxDistance[2] = 350.00
      • Set ColSpray_Levels_MaxDistance[3] = 450.00
      • -------- The longest a unit can be stunned for --------
      • Set ColSpray_Levels_MaxDuration[1] = 6.00
      • Set ColSpray_Levels_MaxDuration[2] = 8.00
      • Set ColSpray_Levels_MaxDuration[3] = 10.00
      • -------- The number of lights to be sprayed fo the effect (multiples of LightsPerTick (below) are best) --------
      • Set ColSpray_Data_Lights = 162
      • -------- The number of lights to be sprayed every 0.05 seconds (multiples of the number of spell levels are best) --------
      • Set ColSpray_Data_LightsPerTick = 9
      • -------- The possible colours of each light --------
      • Set ColSpray_Data_Colors[0] = (Color of Player 1 (Red))
      • Set ColSpray_Data_Colors[1] = (Color of Player 2 (Blue))
      • Set ColSpray_Data_Colors[2] = (Color of Player 3 (Teal))
      • Set ColSpray_Data_Colors[3] = (Color of Player 4 (Purple))
      • Set ColSpray_Data_Colors[4] = (Color of Player 5 (Yellow))
      • Set ColSpray_Data_Colors[5] = (Color of Player 6 (Orange))
      • Set ColSpray_Data_Colors[6] = (Color of Player 7 (Green))
      • Set ColSpray_Data_Colors[7] = (Color of Player 8 (Pink))
      • Set ColSpray_Data_Colors[8] = (Color of Player 9 (Gray))
      • Set ColSpray_Data_Colors[9] = (Color of Player 10 (Light Blue))



  • On Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Colour Spray
    • Actions
      • -------- Retrieve level-specific data --------
      • Set ColSpray_Data_MaxDistance = ColSpray_Levels_MaxDistance[(Level of (Ability being cast) for (Triggering unit))]
      • Set ColSpray_Data_MaxDuration = ColSpray_Levels_MaxDuration[(Level of (Ability being cast) for (Triggering unit))]
      • Set ColSpray_Data_ArcAngle = ColSpray_Levels_ArcAngle[(Level of (Ability being cast) for (Triggering unit))]
      • -------- Determine the points of the caster and target, and the angle between them. --------
      • Set ColSpray_Vars_CastPoint = (Target point of ability being cast)
      • Set ColSpray_Vars_CasterPoint = (Position of (Triggering unit))
      • Set ColSpray_Vars_CastDir = (Angle from ColSpray_Vars_CasterPoint to ColSpray_Vars_CastPoint)
      • -------- Blizzard does angle-betweens odd... converts negatives to over 180's. --------
      • If (ColSpray_Vars_CastDir Less than 0.00) then do (Set ColSpray_Vars_CastDir = (ColSpray_Vars_CastDir + 360.00)) else do (Do nothing)
      • -------- Find units in range. --------
      • Set ColSpray_Groups_AffectedUnits = (Units within ColSpray_Data_MaxDistance of ColSpray_Vars_CasterPoint matching (((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to False))
      • Unit Group - Pick every unit in ColSpray_Groups_AffectedUnits and do (Actions)
        • Loop - Actions
          • -------- Find position of a unit, and the angle to it from the casting point. --------
          • Set ColSpray_Vars_UnitPoint = (Position of (Picked unit))
          • Set ColSpray_Vars_UnitDir = (Angle from ColSpray_Vars_CasterPoint to ColSpray_Vars_UnitPoint)
          • -------- Blizzard does angle-betweens odd... converts negatives to over 180's. --------
          • If (ColSpray_Vars_UnitDir Less than 0.00) then do (Set ColSpray_Vars_UnitDir = (ColSpray_Vars_UnitDir + 360.00)) else do (Do nothing)
          • -------- Find the difference between the casting angle, and the angle to that unit. --------
          • Set ColSpray_Vars_AngleDif = (Abs((ColSpray_Vars_CastDir - ColSpray_Vars_UnitDir)))
          • -------- If the unit is alive, in the arc, a ground unit, and not immune to magic, stun it. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is A ground unit) Equal to True
              • ((Picked unit) is Magic Immune) Equal to False
              • ColSpray_Vars_AngleDif Less than or equal to (ColSpray_Data_ArcAngle / 2.00)
            • Then - Actions
              • -------- Determine distance from caster. --------
              • Set ColSpray_Vars_Distance = (Distance between ColSpray_Vars_CasterPoint and ColSpray_Vars_UnitPoint)
              • -------- Determine duration (based on distance, and max duration) --------
              • -------- If you are one quarter of the max distance away, you'll get three quarters of the duration. --------
              • Set ColSpray_Vars_Duration = (ColSpray_Vars_Distance / ColSpray_Data_MaxDistance)
              • Set ColSpray_Vars_Duration = (1.00 - ColSpray_Vars_Duration)
              • Set ColSpray_Vars_Duration = (ColSpray_Vars_Duration x ColSpray_Data_MaxDuration)
              • Set ColSpray_Vars_Duration = (ColSpray_Vars_Duration + (1.00 - (ColSpray_Vars_Duration mod 1.00)))
              • -------- Stun the unit --------
              • Unit - Create 1 Colour Spray Stunner for (Owner of (Triggering unit)) at ColSpray_Vars_CastPoint facing ColSpray_Vars_UnitPoint
              • Unit - Set level of Stun for (Last created unit) to (Integer(ColSpray_Vars_Duration))
              • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
              • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
            • Else - Actions
      • -------- Create an effect, which sprays a certain amount of lights into the area of effect. --------
      • Unit Group - Add (Triggering unit) to ColSpray_Groups_Casters
      • Hashtable - Save ColSpray_Vars_CastDir as 0 of (Key (Triggering unit)) in ColSpray_Hash
      • Hashtable - Save ColSpray_Data_Lights as 1 of (Key (Triggering unit)) in ColSpray_Hash
      • Hashtable - Save ColSpray_Data_ArcAngle as 2 of (Key (Triggering unit)) in ColSpray_Hash
      • Hashtable - Save (Level of (Ability being cast) for (Triggering unit)) as 3 of (Key (Triggering unit)) in ColSpray_Hash
      • -------- Cleanup --------
      • Custom script: call DestroyGroup( udg_ColSpray_Groups_AffectedUnits )
      • Custom script: call RemoveLocation( udg_ColSpray_Vars_CastPoint )
      • Custom script: call RemoveLocation( udg_ColSpray_Vars_CasterPoint )
      • Custom script: call RemoveLocation( udg_ColSpray_Vars_UnitPoint )



  • Lights Spawn
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • (ColSpray_Groups_Casters is empty) Equal to False
    • Actions
      • Unit Group - Pick every unit in ColSpray_Groups_Casters and do (Actions)
        • Loop - Actions
          • Set ColSpray_Vars_CastDir = (Load 0 of (Key (Picked unit)) from ColSpray_Hash)
          • Set ColSpray_Vars_LightsLeft = (Load 1 of (Key (Picked unit)) from ColSpray_Hash)
          • Set ColSpray_Data_ArcAngle = (Load 2 of (Key (Picked unit)) from ColSpray_Hash)
          • Set ColSpray_Vars_SpellLevel = (Load 3 of (Key (Picked unit)) from ColSpray_Hash)
          • Set ColSpray_Vars_UnitPoint = (Position of (Picked unit))
          • Set Temp_Real = ((Real(ColSpray_Data_LightsPerTick)) x ((Real(ColSpray_Vars_SpellLevel)) / (Real(ColSpray_Data_Levels))))
          • For each (Integer Temp_Int) from 1 to (Integer(Temp_Real)), do (Actions)
            • Loop - Actions
              • Set ColSpray_Vars_UnitDir = ColSpray_Vars_CastDir
              • Unit - Create 1 Colour Spray Light for Neutral Passive at ColSpray_Vars_UnitPoint facing (ColSpray_Vars_CastDir + (Random real number between ((ColSpray_Data_ArcAngle / 2.00) x -1.00) and (ColSpray_Data_ArcAngle / 2.00))) degrees
              • Unit Group - Add (Last created unit) to ColSpray_Groups_Lights
              • Unit - Change color of (Last created unit) to ColSpray_Data_Colors[(Random integer number between 0 and 9)]
              • Unit - Add a ((Random real number between 0.30 and 0.70) x ((Real(ColSpray_Vars_SpellLevel)) / (Real(ColSpray_Data_Levels)))) second Generic expiration timer to (Last created unit)
              • Unit - Turn collision for (Last created unit) Off
          • Set ColSpray_Vars_LightsLeft = (ColSpray_Vars_LightsLeft - ColSpray_Data_LightsPerTick)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ColSpray_Vars_LightsLeft Less than or equal to 0
            • Then - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in ColSpray_Hash
              • Unit Group - Remove (Picked unit) from ColSpray_Groups_Casters
            • Else - Actions
              • Hashtable - Save ColSpray_Vars_LightsLeft as 1 of (Key (Picked unit)) in ColSpray_Hash
      • Custom script: call RemoveLocation( udg_ColSpray_Vars_MovePoint )
      • Custom script: call RemoveLocation( udg_ColSpray_Vars_UnitPoint )



  • Move Lights
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (ColSpray_Groups_Lights is empty) Equal to False
    • Actions
      • Unit Group - Pick every unit in ColSpray_Groups_Lights and do (Actions)
        • Loop - Actions
          • Set ColSpray_Vars_UnitPoint = (Position of (Picked unit))
          • Set ColSpray_Vars_MovePoint = (ColSpray_Vars_UnitPoint offset by 18.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to ColSpray_Vars_MovePoint



  • Related Death
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Colour Spray Light
        • Then - Actions
          • Unit Group - Remove (Dying unit) from ColSpray_Groups_Lights
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Dying unit) is in ColSpray_Groups_Casters) Equal to True
            • Then - Actions
              • Hashtable - Clear all child hashtables of child (Key (Dying unit)) in ColSpray_Hash
              • Unit Group - Remove (Dying unit) from ColSpray_Groups_Casters
            • Else - Actions





v1.1:
-Increased trigger efficiency
-Lumped all death triggers into one (Related Death)

v1.2:
-Units are stunned instead of paused
-Removed "Update Duration" trigger (no longer needed)
-Arc for the affected area now scales with level

v1.3:
-Effects now scale with level

v1.4:
-Fixed effect not showing when units were affected

v1.5:
-Fixed effect sometimes not showing when casting towards the Northwest o_O


Keywords:
color, colour, spray, cone, wave, arc, stun, paralyze, light, Dungeons, Dragons, AoE, crowd, control
Contents

Colour Spray v1.5 (Map)

Reviews
11:34, 28th Jul 2010 TriggerHappy: Thanks for updating your spell.

Moderator

M

Moderator

11:34, 28th Jul 2010
TriggerHappy:

Thanks for updating your spell.
 
Level 9
Joined
Dec 25, 2008
Messages
110
That is a LOT of triggers for just one spell. However, GUI doesn't give you much of a choice .Haven't tested it yet so I won't rate it until I do.(I'll update my post when I have)

Tested it and: it doesn't seem to leak and it has nice effects. Also, the stun seems to work nicely.

However I don't think you should use so many triggers for just one spell, since it is not necessary to put the actions of some triggers in different triggers.

In short, since most map makers wouldn't pick this spell (if they are lazy)
but it is a spell that doesn't leak and is eye candy I will give it a 3/5, although if you reduce the amount of triggers of this spell I will give it +1/5 to 4/5.
 
Last edited:
Level 31
Joined
May 3, 2008
Messages
3,155
don't use casting or dying unit, use triggering unit cause it is instant.

also, trigger that share the same event could all been done in a single trigger.

separating them was rather a bad idea cause it just like you are calling 2 ppl to make you a cup of coffee while all you need was just 1 person.

don't use integer A, create your own integer to used it.

well, i take a quick glance and this is what i saw soo far.. did't really read the code carefully yet.
 
Level 5
Joined
Aug 27, 2008
Messages
126
ok wtf.. I activate the spell and no effects? I am testing it with 1.24 ver warcarft 3 but I see nothing of that which is on the screenshot. All it does is stun the enemy. I took a look at the triggers and it really is suppose to spawn dummy units but wtf.. guess its something from my wc3 ;/ Nice spell tho I was wondering how to make a stun effect like that.
 
Level 7
Joined
Mar 2, 2008
Messages
180
ok wtf.. I activate the spell and no effects? I am testing it with 1.24 ver warcarft 3 but I see nothing of that which is on the screenshot. All it does is stun the enemy. I took a look at the triggers and it really is suppose to spawn dummy units but wtf.. guess its something from my wc3 ;/ Nice spell tho I was wondering how to make a stun effect like that.

Yeah, I think I just bugged it when it affects units... fixing...

EDIT: That appears to be fixed. It was an integer rounding error. I had to convert some things to reals.

@TriggerHappy: I fixed that, too.
 
Level 8
Joined
Jun 30, 2010
Messages
259
You could actually make a nice simillar spell using less triggers.
Simply crate a dummy unit at the position of the caster, or more units for a nicer effect, and make them cast a cluster rockets with no effect and you add the units later as you have done, and you will have your stun and arc, it won't look as nice, but I think it is an easier way to make the spell you have made, and your spell allows you to easily adjust the ammount of units and a more precise stun.

The triggers are a bit advanced and not something you can import into your map and change the way you like it.
It is however a nice spell and it could be changed if you know what you're doing.
I'll give it a 4/5 at the moment, bacause I would like:
-Longer cast range
-The spell to do some damage (atleast make a trigger that you can import and CHANGE so that it does damage)
-Animation at each unit hit by a light, this would look nice, but can be hard.
If you think i am too hard on you because these things are'nt supposed to be in the spell, then another reason for the 4/5 is because I think it lacks some effects.
 
Level 6
Joined
Aug 20, 2009
Messages
95
Can you add some damage to it? I'd like to use it in a map I have, but it requires damage, Please and thanks, Or tell me how, im OK with the editor, but I dont understand crap in yours haha, too many, but still, i'd give it a 5/5 for Eyecandy, I've been looking for something like this
 
Can you add some damage to it? I'd like to use it in a map I have, but it requires damage, Please and thanks, Or tell me how, im OK with the editor, but I dont understand crap in yours haha, too many, but still, i'd give it a 5/5 for Eyecandy, I've been looking for something like this

you can add damage to the dummy stormbolt spell or add a Unit - Damage unit action on the part where he casts the storm bolt to stun the units (on the onCast trigger)
 
Level 3
Joined
May 24, 2016
Messages
22
Could be wrong, but after some testing, the max distance you have does nothing. Or rather, your function doesn't listen to it.

To fix, you need to fix the expiration timer for the light dummy. You currently have:

Code:
Unit - Add a ((Random real number between 0.30 and 0.70) x ((Real(ColSpray_Vars_SpellLevel)) / (Real(ColSpray_Data_Levels)))) second Generic expiration timer to (Last created unit)

I think this fixes it so that it has a proper expiration timer regardless of the number of levels or distances set

Code:
Unit - Add a ((Random real number between 0.15 and ((ColSpray_Levels_MaxDistance[ColSpray_Vars_SpellLevel] x 166.00) / 100000.00)) x 1.00) second Generic expiration timer to (Last created unit)


At least, so far to my testing that does appropriate distance for any set of levels.


EDIT: Found another bug--for some reason, when copied over, it randomly won't spawn lights. The rest of the ability will trigger, but it won't produce the color spray effect. Not sure why.
 
Last edited:
Top