• 🏆 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!

Freezing Bow v. 1.5

Fires a Frozen Arrow on a target unit or point, when the arrow hits the target, if the target is a unit, it will damage him, if the target is a point, it will damage units in 100 AoE and splits into multiple arrows arrows in an AoE, splitted arrows go to a random location in the AoE and when they hit that location, they explode dealing light damage in 175 AoE and slowing for 4 seconds by 35% attack speed and 50% movement speed.
Level 1 - 100 damage, 5 arrows, 250 AoE, 25 damage. (Point Target)
Level 2 - 150 damage, 15 arrows, 350 AoE, 50 damage. (Unit Target)
Level 3 - 200 damage, 25 arrows, 450 AoE, 75 damage. (Unit or Point Target)

Spell Can be Switched between Point Target or Unit Target

(1)

(2)

(3)

(4)

225233-albums6219-picture72352.jpg
225233-albums6219-picture72353.jpg
225233-albums6219-picture72354.jpg
225233-albums6219-picture72351.jpg


  • FB Initial
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do Not Change --------
      • Hashtable - Create a hashtable
      • Set FB_HA = (Last created hashtable)
      • -------- Do Not Change --------
      • -------- Please Re-Set these Values when importing --------
      • Set FB_Ability = Freezing Bow
      • Set FB_Dummy_Ability = Dummy Ability
      • Set FB_Dummies[1] = Freezing Bow Dummy 1
      • Set FB_Dummies[2] = Freezing Bow Dummy 2
      • Set FB_Dummies[3] = Freezing Bow Dummy 3
      • -------- Please Re-Set these Values when importing --------
      • -------- Random splitting set to true makes arrows split randomly, if set to false, arrows will split in a symetrique way --------
      • Set FB_Random_Splitting = True
      • -------- Effects --------
      • Set FB_Fx_Split = Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl
      • Set FB_Fx_Blow = Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
      • Set FB_Fx_Missile = Abilities\Spells\Other\FrostArrows\NagaColdArrowMissile.mdl
      • -------- AoE of the Spell --------
      • Set FB_AoE[1] = 150.00
      • Set FB_AoE[2] = 300.00
      • Set FB_AoE[3] = 450.00
      • -------- Primary Target Damage --------
      • Set FB_Dmg[1] = 100.00
      • Set FB_Dmg[2] = 150.00
      • Set FB_Dmg[3] = 200.00
      • -------- Primary Missile Speed --------
      • Set FB_MissileSpeed[1] = 1500.00
      • Set FB_MissileSpeed[2] = 1500.00
      • Set FB_MissileSpeed[3] = 1500.00
      • -------- AoE of damage and slow of spreading arrows --------
      • Set FB_SpreadAoE[1] = 175.00
      • Set FB_SpreadAoE[2] = 175.00
      • Set FB_SpreadAoE[3] = 175.00
      • -------- Amount of arrows spreaded --------
      • Set FB_Spread_Arrows[1] = 5
      • Set FB_Spread_Arrows[2] = 15
      • Set FB_Spread_Arrows[3] = 25
      • -------- Spread arrows damage --------
      • Set FB_SpreadDmg[1] = 25.00
      • Set FB_SpreadDmg[2] = 50.00
      • Set FB_SpreadDmg[3] = 75.00
      • -------- Spread Arrows Missile Speed --------
      • Set FB_SpreadMissileSpeed[1] = 750.00
      • Set FB_SpreadMissileSpeed[2] = 750.00
      • Set FB_SpreadMissileSpeed[3] = 750.00
  • FB Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FB_Ability
    • Actions
      • Set Unit = (Triggering unit)
      • Set x = (Level of FB_Ability for Unit)
      • Set loc = (Position of Unit)
      • Set Unit1 = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Unit1 Not equal to No unit
        • Then - Actions
          • Set loc1 = (Position of Unit1)
          • Unit - Create 1 FB_Dummies[1] for (Triggering player) at loc facing (Angle from loc to loc1) degrees
          • Set Unit2 = (Last created unit)
          • Special Effect - Create a special effect attached to the origin of Unit2 using FB_Fx_Missile
          • Custom script: set udg_Key = GetHandleId(udg_Unit2)
          • Set y = (Default flying height of Unit1)
          • Animation - Change Unit2 flying height to (y + 65.00) at (y / ((Distance between loc and loc1) / (0.75 x FB_MissileSpeed[x])))
          • Hashtable - Save Handle OfUnit1 as 1 of Key in FB_HA
          • Hashtable - Save Unit as 3 of Key in FB_HA
        • Else - Actions
          • Set loc1 = (Target point of ability being cast)
          • Unit - Create 1 FB_Dummies[1] for (Triggering player) at loc facing (Angle from loc to loc1) degrees
          • Set Unit2 = (Last created unit)
          • Special Effect - Create a special effect attached to the origin of Unit2 using FB_Fx_Missile
          • Custom script: set udg_Key = GetHandleId(udg_Unit2)
          • Hashtable - Save (X of loc1) as 1 of Key in FB_HA
          • Hashtable - Save (Y of loc1) as 2 of Key in FB_HA
          • Hashtable - Save Point as 3 of Key in FB_HA
      • Hashtable - Save Handle Of(Last created special effect) as 4 of Key in FB_HA
      • Hashtable - Save x as 0 of Key in FB_HA
      • Unit Group - Add Unit2 to FB_Group
      • Set Unit = No unit
      • Set Unit1 = No unit
      • Set Unit2 = No unit
      • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call RemoveLocation(udg_loc1)
      • Trigger - Turn on FB Loop <gen>
  • FB Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FB_Group and do (Actions)
        • Loop - Actions
          • Set Unit = (Picked unit)
          • Custom script: set udg_Key = GetHandleId(udg_Unit)
          • Set x = (Load 0 of Key from FB_HA)
          • Set loc = (Position of Unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Unit) Equal to FB_Dummies[1]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 3 of Key from FB_HA) Equal to Unit
                • Then - Actions
                  • Set Unit1 = (Load 1 of Key in FB_HA)
                  • Set loc1 = (Position of Unit1)
                  • Set loc2 = (loc offset by (FB_MissileSpeed[x] x 0.03) towards (Angle from loc to loc1) degrees)
                  • Unit - Move Unit instantly to loc2, facing loc1
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Distance between loc1 and loc2) Less than or equal to 65.00
                          • (Unit1 is dead) Equal to True
                    • Then - Actions
                      • For each (Integer x2) from 1 to FB_Spread_Arrows[x], do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • FB_Random_Splitting Equal to True
                            • Then - Actions
                              • Set loc3 = (loc2 offset by (Random real number between 100.00 and FB_AoE[x]) towards (Random angle) degrees)
                            • Else - Actions
                              • Set loc3 = (loc2 offset by ((FB_AoE[x] / (Real(FB_Spread_Arrows[x]))) x (Real(x2))) towards ((450.00 / (Real(FB_Spread_Arrows[x]))) x (Real(x2))) degrees)
                          • Unit - Create 1 FB_Dummies[2] for (Owner of Unit) at loc2 facing (Angle from loc to loc3) degrees
                          • Set Unit2 = (Last created unit)
                          • Custom script: set udg_Key1 = GetHandleId(udg_Unit2)
                          • Special Effect - Create a special effect attached to the origin of Unit2 using FB_Fx_Missile
                          • Hashtable - Save Handle Of(Last created special effect) as 4 of Key1 in FB_HA
                          • Set y = (Current flying height of Unit)
                          • Animation - Change Unit2 flying height to y at 0.00
                          • Animation - Change Unit2 flying height to 0.00 at (y / ((Distance between loc2 and loc3) / (0.80 x FB_SpreadMissileSpeed[x])))
                          • Unit Group - Add Unit2 to FB_Group
                          • Hashtable - Save x as 0 of Key1 in FB_HA
                          • Hashtable - Save (Distance between loc2 and loc3) as 1 of Key1 in FB_HA
                          • Hashtable - Save (Angle from loc2 to loc3) as 2 of Key1 in FB_HA
                          • Custom script: call RemoveLocation(udg_loc3)
                          • Set Unit2 = No unit
                      • Special Effect - Create a special effect at loc1 using FB_Fx_Blow
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Destroy (Load 4 of Key in FB_HA)
                      • Unit - Cause Unit to damage Unit1, dealing FB_Dmg[x] damage of attack type Spells and damage type Magic
                      • Unit - Kill Unit
                      • Unit Group - Remove Unit from FB_Group
                      • Hashtable - Clear all child hashtables of child Key in FB_HA
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (FB_Group is empty) Equal to True
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                  • Set Unit1 = No unit
                  • Custom script: call RemoveLocation(udg_loc1)
                  • Custom script: call RemoveLocation(udg_loc2)
                • Else - Actions
                  • Set loc1 = (Point((Load 1 of Key from FB_HA), (Load 2 of Key from FB_HA)))
                  • Set loc2 = (loc offset by (FB_MissileSpeed[x] x 0.03) towards (Angle from loc to loc1) degrees)
                  • Unit - Move Unit instantly to loc2, facing loc1
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between loc1 and loc2) Less than or equal to 65.00
                    • Then - Actions
                      • For each (Integer x2) from 1 to FB_Spread_Arrows[x], do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • FB_Random_Splitting Equal to True
                            • Then - Actions
                              • Set loc3 = (loc2 offset by (Random real number between 100.00 and FB_AoE[x]) towards (Random angle) degrees)
                            • Else - Actions
                              • Set loc3 = (loc2 offset by ((FB_AoE[x] / (Real(FB_Spread_Arrows[x]))) x (Real(x2))) towards ((450.00 / (Real(FB_Spread_Arrows[x]))) x (Real(x2))) degrees)
                          • Unit - Create 1 FB_Dummies[2] for (Owner of Unit) at loc2 facing (Angle from loc to loc3) degrees
                          • Set Unit2 = (Last created unit)
                          • Custom script: set udg_Key1 = GetHandleId(udg_Unit2)
                          • Special Effect - Create a special effect attached to the origin of Unit2 using FB_Fx_Missile
                          • Hashtable - Save Handle Of(Last created special effect) as 4 of Key1 in FB_HA
                          • Set y = (Current flying height of Unit)
                          • Animation - Change Unit2 flying height to y at 0.00
                          • Animation - Change Unit2 flying height to 0.00 at (y / ((Distance between loc2 and loc3) / (0.80 x FB_SpreadMissileSpeed[x])))
                          • Unit Group - Add Unit2 to FB_Group
                          • Hashtable - Save x as 0 of Key1 in FB_HA
                          • Hashtable - Save (Distance between loc2 and loc3) as 1 of Key1 in FB_HA
                          • Hashtable - Save (Angle from loc2 to loc3) as 2 of Key1 in FB_HA
                          • Custom script: call RemoveLocation(udg_loc3)
                          • Set Unit2 = No unit
                      • Set UGroup = (Units within 100.00 of loc1 matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is dead) Equal to False)) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an ally of (Owner of Unit)) Equa
                      • Unit Group - Pick every unit in UGroup and do (Unit - Cause Unit to damage (Picked unit), dealing FB_Dmg[x] damage of attack type Spells and damage type Magic)
                      • Custom script: call DestroyGroup(udg_UGroup)
                      • Special Effect - Destroy (Load 4 of Key in FB_HA)
                      • Special Effect - Create a special effect at loc1 using FB_Fx_Blow
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Kill Unit
                      • Unit Group - Remove Unit from FB_Group
                      • Hashtable - Clear all child hashtables of child Key in FB_HA
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (FB_Group is empty) Equal to True
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_loc1)
                  • Custom script: call RemoveLocation(udg_loc2)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of Unit) Equal to FB_Dummies[2]
                • Then - Actions
                  • Set y = (Load 1 of Key from FB_HA)
                  • Set y = (y - (FB_SpreadMissileSpeed[x] x 0.03))
                  • Hashtable - Save y as 1 of Key in FB_HA
                  • Set loc1 = (loc offset by 15.00 towards (Load 2 of Key from FB_HA) degrees)
                  • Set loc2 = (loc offset by (FB_SpreadMissileSpeed[x] x 0.03) towards (Angle from loc to loc1) degrees)
                  • Unit - Move Unit instantly to loc2
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • y Less than or equal to 0.00
                    • Then - Actions
                      • Special Effect - Destroy (Load 4 of Key in FB_HA)
                      • Unit - Create 1 FB_Dummies[3] for (Owner of Unit) at loc2 facing Default building facing degrees
                      • Set Unit2 = (Last created unit)
                      • Unit - Add FB_Dummy_Ability to Unit2
                      • Unit - Add a 0.15 second Generic expiration timer to (Last created unit)
                      • Set UGroup = (Units within FB_SpreadAoE[x] of loc2 matching (((Matching unit) is dead) Equal to False))
                      • Unit Group - Pick every unit in UGroup and do (Actions)
                        • Loop - Actions
                          • Set Unit1 = (Picked unit)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit1 is A structure) Equal to False
                              • (Unit1 belongs to an ally of (Owner of Unit)) Equal to False
                              • (Unit1 is Magic Immune) Equal to False
                            • Then - Actions
                              • Special Effect - Create a special effect attached to the origin of Unit1 using FB_Fx_Split
                              • Special Effect - Destroy (Last created special effect)
                              • Unit - Order Unit2 to Undead Necromancer - Cripple Unit1
                              • Unit - Cause Unit to damage Unit1, dealing FB_SpreadDmg[x] damage of attack type Spells and damage type Magic
                            • Else - Actions
                          • Set Unit1 = No unit
                      • Custom script: call DestroyGroup(udg_UGroup)
                      • Unit - Kill Unit
                      • Unit Group - Remove Unit from FB_Group
                      • Hashtable - Clear all child hashtables of child Key in FB_HA
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (FB_Group is empty) Equal to True
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_loc1)
                  • Custom script: call RemoveLocation(udg_loc2)
                • Else - Actions
          • Set Unit = No unit
          • Custom script: call RemoveLocation(udg_loc)
V. 1.0
Uploaded at Hive
V. 1.1
*Fixed the Ability Condition which didn't use the variable ability
*Changed the Key set to GetHandleId()
*Added the Possibility of choosing whether the Spell is Point Target or Unit Target
V. 1.2
*Now the target type is taken automatically instead of needing to be set manually
*Now Point - Target spell will damage units in 100 AoE with the primary damage
*Minor Lines change
V. 1.3

*Now you can choose whether the arrows will split randomly or not
*Now if an arrow's unit target is dead before the arrow hits him, instead of just killing the arrow, the arrow will split in it's place
*Made the Picking Units more "readable" :p
*Some Trigger Fixes
V. 1.4
Triggers' Optimization
V. 1.5
*Trigger Improvements
*Now the missile Fx can be directly changed for all missiles from the initial trigger
*Added a How to Import in a Trigger Comment

Note that the Spell Requires to have the dummy.mdx file
Keywords:
Bow, Arrow, Slow, Freeze, Archer, Ice, Frost, Cold, July's Monthly news Batch
Contents

Freezing Bow (Map)

Reviews
08:05, 26th Jul 2013 Magtheridon96: Approved.
Level 16
Joined
Jul 31, 2012
Messages
2,217
Thanks, for the effects, i thought of making them configurable, but then i thought.. Why hell do people need to change the effects lol, they want the spell or another one?
Any way, i usually upload the basic version, which is not very important, like i plan to add more cool stuff to that one...
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
@dimf
Just a note.
If you are suggesting that changes, please make sure to notify users to use this:
set udg_SomeKey = GetHandleId(udg_SomeUnit)

the only time they have to use that is if they are using JNGP.

try to copy his triggers into ur JNGP and they will work fine even if u cant edit them without changing it to custom script
 
Level 33
Joined
Apr 24, 2012
Messages
5,113
Review:
1) Needs documentation
2) at cast trigger, you must cache Default Flying Height of blah blah and use it in the parameters.
3)Cache Last created unit
4)If you are going to use keys, you can just use this method:

  • Set MyUnit = someUnit
  • Custom script : set udg_MyKey = GetHandleId(udg_MyUnit)
Because this reduces repetitive calls of functions.
5) The special effect models in the Loop trigger must be configurable.
6) To add readability in filtering units in Unit Group enumerations, you can just put them inside the Pick Every Unit block.
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
Update
*Made the Point/Unit Target system automatic instead of being set in the initialization
*Now Point Target spell deals the primary damage in 100 AoE
*Minor trigger lines changes


@Almia
i'll stop arguing after this:
JASS:
If this kind of thing is very "READABLE" than my name is not Jad
it may seem weird, but there is no real need of splitting all the conditions :/ same result, you want it to be configurable? yh... wait further versions.. there will be booleans that will check if u want dis or dis

and just a little final:
+SWAG :p Mago
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
@Almia
i'll stop arguing after this:
JASS:
If this kind of thing is very "READABLE" than my name is not Jad
it may seem weird, but there is no real need of splitting all the conditions :/ same result, you want it to be configurable? yh... wait further versions.. there will be booleans that will check if u want dis or dis.

Funny how TESH made the sentence really readable :cgrin:

Anyway, Almia is right about this. By splitting the condition, the users can easily configure the type of target they want. The effort spent is minor but the achieved result is commendable. Compare:

  • Set TempGroup = (Units within 512.00 of (Center of (Playable map area)) matching ((((Triggering unit) is alive) Equal to True) and ((((Triggering unit) sleeps when unprovoked) Equal to True) and ((((Triggering unit) belongs to an enemy of Player 1 (Red)) Equal to True) and (
and

  • Set TempGroup = (Units within 512.00 of (Center of (Playable map area)))
  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A structure) Equal to True
          • ((Picked unit) is alive) Equal to True
          • ((Picked unit) is A structure) Equal to False
          • ((Picked unit) sleeps when unprovoked at night) Equal to True
          • ((Picked unit) belongs to an enemy of Player 1 (Red)) Equal to True
        • Then - Actions
        • Else - Actions
Off-topic: O the horrible stretching!
 
Last edited:
Level 16
Joined
Jul 31, 2012
Messages
2,217
@daffa
There are some other spells which trigger (not trigger's') is about 3x the loop trigger here :p it is a bit big because the system destroys the projectile if the target dies and because the system of the spell supports both unit and ground target

@doomlord
Yh i guess it will be for next time :p
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
@Doomlord
u call picked unit a lot in here.
u should store it into a temp variable

  • ((Picked unit) is A structure) Equal to True
  • ((Picked unit) is alive) Equal to True
  • ((Picked unit) is A structure) Equal to False
  • ((Picked unit) sleeps when unprovoked at night) Equal to True
  • ((Picked unit) belongs to an enemy of Player 1 (Red)) Equal to True
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
It is funny how example code have to be judged so harshly.

Yes I am perfectly aware of that. But it is just an example to support Almia' point. I am not even phrasing it as "what you should copy from".

On a side note, I don't even intend to post here. Just feel like dropping by to say a few words. I normally avoid touching GUI spells.
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
Thanks. This will serve as a reminder for me not to touch GUI codes again.

Points to be presented:

  • The OP is not a GUI newbie.
  • I am posting an EXAMPLE code. The obvious purpose of which is to clarify a valid argument made by Almia but valiantly defied by DotCa.
  • I didn't include any kind of "Hey please follow my GUI code because I have high rep blah blah blah"

I believe not even the mods post efficient example code unless it is relevant to what they are trying to say.

We should agree to disagree here. Really.
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
Update
*Now you can choose whether the arrows will split randomly or not
*Now if an arrow's unit target is dead before the arrow hits him, instead of just killing the arrow, the arrow will split in it's place
*Made the Picking Units more "readable" :p
*Some Trigger Fixes
 
Level 33
Joined
Apr 24, 2012
Messages
5,113
In the cast trigger, cache first the Target Unit then use it inside the parameters(you are cacheing it after using Target Unit :( )
Also, create first the dummy, so that you can combine the two ifs.

Also, you didn't view my suggestion about keys. Use GetHandleId instead so you won't call Key Last Created Unit over and over again.

Cache Current Flying Height of Unit inside a variable
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
Almia said:
In the cast trigger, cache first the Target Unit then use it inside the parameters(you are cacheing it after using Target Unit :( )
Yh, ok
Almia said:
Also, create first the dummy, so that you can combine the two ifs.
ok, too
Almia said:
Also, you didn't view my suggestion about keys. Use GetHandleId instead so you won't call Key Last Created Unit over and over again.
I did, look in the loop trigger
in the cast trigger... it wasn't so necessary :/
Almia said:
Cache Current Flying Height of Unit inside a variable
Hell why, i only use it once... why caching it ://
 
Top