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

Phantom Bolt v1.2

Credits to Deuterium (of course) for helping to fix a bug.

Here it is, omg! Phantom Bolt!

The spell:
Phantom Bolt
Fires a strand of dark magic at a target point. A heading bolt leads 2 smaller bolts at a fast rate towards the target point. Any enemy it collides with will take damage. The 2 smaller bolts then swing around either side of the impact point until they collide with eachother or an enemy. Occurs automatically after a certain distance.
Level 1 - First bolt deals 80 damage, smaller bolts deal 45 damage.
Level 2 - First bolt deals 120 damage, smaller bolts deal 60 damage.
Level 3 - First bolt deals 160 damage, smaller bolts deal 75 damage.
The code:
  • Phantom Bolt Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Phantom Bolt
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • pb_index1 Equal to 0
        • Then - Actions
          • Trigger - Turn on Phantom Bolt Per <gen>
        • Else - Actions
      • Set pb_index1 = (pb_index1 + 1)
      • Set pb_index2 = (pb_index2 + 1)
      • Set pb_loopon[pb_index2] = True
      • Set pb_caster[pb_index2] = (Triggering unit)
      • Set pb_caster_loc[pb_index2] = (Position of pb_caster[pb_index2])
      • Set pb_target_loc[pb_index2] = (Target point of ability being cast)
      • Set pb_angle_1[pb_index2] = (Angle from pb_caster_loc[pb_index2] to pb_target_loc[pb_index2])
      • Set pb_angle_2[pb_index2] = (Angle from pb_caster_loc[pb_index2] to pb_target_loc[pb_index2])
      • Set pb_segment_1[pb_index2] = (pb_caster_loc[pb_index2] offset by 200.00 towards pb_angle_1[pb_index2] degrees)
      • Set pb_segment_2[pb_index2] = (pb_caster_loc[pb_index2] offset by 75.00 towards pb_angle_1[pb_index2] degrees)
      • Set pb_segment_3[pb_index2] = (pb_caster_loc[pb_index2] offset by 75.00 towards pb_angle_2[pb_index3] degrees)
      • Unit - Create 1 effect Phantom (Greater) for (Owner of pb_caster[pb_index2]) at pb_segment_1[pb_index2] facing pb_angle_1[pb_index2] degrees
      • Set pb_effect_1[pb_index2] = (Last created unit)
      • Unit - Create 1 effect Phantom for (Owner of pb_caster[pb_index2]) at pb_segment_2[pb_index2] facing pb_angle_1[pb_index2] degrees
      • Set pb_effect_2[pb_index2] = (Last created unit)
      • Unit - Create 1 effect Phantom for (Owner of pb_caster[pb_index2]) at pb_segment_3[pb_index2] facing pb_angle_2[pb_index2] degrees
      • Set pb_effect_3[pb_index2] = (Last created unit)
      • Lightning - Create a Finger of Death lightning effect from source pb_segment_1[pb_index2] to target pb_segment_2[pb_index2]
      • Set pb_light_1[pb_index2] = (Last created lightning effect)
      • Lightning - Change color of pb_light_1[pb_index2] to (0.75 0.00 1.00) with 1.00 alpha
      • Lightning - Create a Finger of Death lightning effect from source pb_segment_1[pb_index2] to target pb_segment_3[pb_index2]
      • Set pb_light_2[pb_index2] = (Last created lightning effect)
      • Lightning - Change color of pb_light_2[pb_index2] to (0.75 0.00 1.00) with 1.00 alpha
  • Phantom Bolt Per
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer pb_index3) from 1 to pb_index2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • pb_loopon[pb_index3] Equal to True
            • Then - Actions
              • Set pb_counter[pb_index3] = (pb_counter[pb_index3] + 0.03)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • pb_counter[pb_index3] Less than or equal to 1.07
                • Then - Actions
                  • Set pb_segment_1[pb_index3] = (pb_segment_1[pb_index3] offset by 35.00 towards pb_angle_1[pb_index3] degrees)
                  • Set pb_segment_2[pb_index3] = (pb_segment_2[pb_index3] offset by 30.00 towards pb_angle_1[pb_index3] degrees)
                  • Set pb_segment_3[pb_index3] = (pb_segment_3[pb_index3] offset by 30.00 towards pb_angle_2[pb_index3] degrees)
                  • Unit - Move pb_effect_1[pb_index3] instantly to pb_segment_1[pb_index3]
                  • Unit - Move pb_effect_2[pb_index3] instantly to pb_segment_2[pb_index3]
                  • Unit - Move pb_effect_3[pb_index3] instantly to pb_segment_3[pb_index3]
                  • Lightning - Move pb_light_1[pb_index3] to source pb_segment_1[pb_index3] and target pb_segment_2[pb_index3]
                  • Lightning - Move pb_light_2[pb_index3] to source pb_segment_1[pb_index3] and target pb_segment_3[pb_index3]
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within 115.00 of pb_segment_1[pb_index3] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of pb_caster[pb_index3])) Equal to True)))) and do (Actions)
                    • Loop - Actions
                      • Unit - Cause pb_caster[pb_index3] to damage (Picked unit), dealing (40.00 + (40.00 x (Real((Level of Phantom Bolt for pb_caster[pb_index3]))))) damage of attack type Spells and damage type Normal
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_1[pb_index3]
                      • Special Effect - Create a special effect at pb_segment_1[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_1[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Set pb_distance_1[pb_index3] = (Distance between pb_segment_1[pb_index3] and pb_segment_2[pb_index3])
                      • Set pb_distance_2[pb_index3] = (Distance between pb_segment_1[pb_index3] and pb_segment_3[pb_index3])
                      • Custom script: call RemoveLocation(udg_pb_caster_loc[udg_pb_index3])
                      • Custom script: call RemoveLocation(udg_pb_target_loc[udg_pb_index3])
                      • Set pb_counter[pb_index3] = 1.09
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • pb_counter[pb_index3] Greater than or equal to 1.08
                      • pb_counter[pb_index3] Less than or equal to 1.15
                • Then - Actions
                  • Animation - Change pb_effect_1[pb_index3]'s vertex coloring to (50.00%, 50.00%, 50.00%) with 0.00% transparency
                  • Animation - Change pb_effect_1[pb_index3]'s size to (300.00%, 300.00%, 300.00%) of its original size
                  • Set pb_distance_1[pb_index3] = (Distance between pb_segment_1[pb_index3] and pb_segment_2[pb_index3])
                  • Set pb_distance_2[pb_index3] = (Distance between pb_segment_1[pb_index3] and pb_segment_3[pb_index3])
                  • Custom script: call RemoveLocation(udg_pb_caster_loc[udg_pb_index3])
                  • Custom script: call RemoveLocation(udg_pb_target_loc[udg_pb_index3])
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • pb_counter[pb_index3] Greater than or equal to 1.09
                • Then - Actions
                  • Set pb_angle_1[pb_index3] = (pb_angle_1[pb_index3] + 5.10)
                  • Set pb_angle_2[pb_index3] = (pb_angle_2[pb_index3] - 5.10)
                  • Set pb_segment_2[pb_index3] = (pb_segment_1[pb_index3] offset by pb_distance_1[pb_index3] towards (pb_angle_1[pb_index3] + 180.00) degrees)
                  • Set pb_segment_3[pb_index3] = (pb_segment_1[pb_index3] offset by pb_distance_2[pb_index3] towards (pb_angle_2[pb_index3] + 180.00) degrees)
                  • Unit - Move pb_effect_2[pb_index3] instantly to pb_segment_2[pb_index3]
                  • Unit - Move pb_effect_3[pb_index3] instantly to pb_segment_3[pb_index3]
                  • Lightning - Move pb_light_1[pb_index3] to source pb_segment_1[pb_index3] and target pb_segment_2[pb_index3]
                  • Lightning - Move pb_light_2[pb_index3] to source pb_segment_1[pb_index3] and target pb_segment_3[pb_index3]
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within 75.00 of pb_segment_2[pb_index3] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of pb_caster[pb_index3])) Equal to True)))) and do (Actions)
                    • Loop - Actions
                      • Unit - Cause pb_caster[pb_index3] to damage (Picked unit), dealing (30.00 + (15.00 x (Real((Level of Phantom Bolt for pb_caster[pb_index3]))))) damage of attack type Spells and damage type Normal
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_1[pb_index3]
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_2[pb_index3]
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_3[pb_index3]
                      • Lightning - Destroy pb_light_1[pb_index3]
                      • Lightning - Destroy pb_light_2[pb_index3]
                      • Special Effect - Create a special effect at pb_segment_1[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_2[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_3[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_1[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_2[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_3[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation(udg_pb_segment_1[udg_pb_index3])
                      • Custom script: call RemoveLocation(udg_pb_segment_2[udg_pb_index3])
                      • Custom script: call RemoveLocation(udg_pb_segment_3[udg_pb_index3])
                      • Set pb_counter[pb_index3] = 0.00
                      • Set pb_loopon[pb_index3] = False
                      • Set pb_index1 = (pb_index1 - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • pb_index1 Equal to 0
                        • Then - Actions
                          • Set pb_index2 = 0
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                      • Skip remaining actions
                  • Unit Group - Pick every unit in (Units within 75.00 of pb_segment_3[pb_index3] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of pb_caster[pb_index3])) Equal to True)))) and do (Actions)
                    • Loop - Actions
                      • Unit - Cause pb_caster[pb_index3] to damage (Picked unit), dealing (30.00 + (15.00 x (Real((Level of Phantom Bolt for pb_caster[pb_index3]))))) damage of attack type Spells and damage type Normal
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_1[pb_index3]
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_2[pb_index3]
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_3[pb_index3]
                      • Lightning - Destroy pb_light_1[pb_index3]
                      • Lightning - Destroy pb_light_2[pb_index3]
                      • Special Effect - Create a special effect at pb_segment_1[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_2[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_3[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_1[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_2[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_3[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation(udg_pb_segment_1[udg_pb_index3])
                      • Custom script: call RemoveLocation(udg_pb_segment_2[udg_pb_index3])
                      • Custom script: call RemoveLocation(udg_pb_segment_3[udg_pb_index3])
                      • Set pb_counter[pb_index3] = 0.00
                      • Set pb_loopon[pb_index3] = False
                      • Set pb_index1 = (pb_index1 - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • pb_index1 Equal to 0
                        • Then - Actions
                          • Set pb_index2 = 0
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                      • Skip remaining actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • pb_counter[pb_index3] Greater than or equal to 2.09
                    • Then - Actions
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_1[pb_index3]
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_2[pb_index3]
                      • Unit - Add a 0.01 second Generic expiration timer to pb_effect_3[pb_index3]
                      • Lightning - Destroy pb_light_1[pb_index3]
                      • Lightning - Destroy pb_light_2[pb_index3]
                      • Special Effect - Create a special effect at pb_segment_1[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_2[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_3[pb_index3] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_1[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_2[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at pb_segment_3[pb_index3] using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation(udg_pb_segment_1[udg_pb_index3])
                      • Custom script: call RemoveLocation(udg_pb_segment_2[udg_pb_index3])
                      • Custom script: call RemoveLocation(udg_pb_segment_3[udg_pb_index3])
                      • Set pb_counter[pb_index3] = 0.00
                      • Set pb_loopon[pb_index3] = False
                      • Set pb_index1 = (pb_index1 - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • pb_index1 Equal to 0
                        • Then - Actions
                          • Set pb_index2 = 0
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                • Else - Actions
            • Else - Actions
Feel free to use this or any form of this as long as you credit me (StaberFire) for the original idea. At least I hope it's original. =P

ENJOY!

UPDATE1: Altered offset to enable the consideration of melee-range units and disabled fog in test map.
UPDATE2: I (reluctantly) removed the custom icon, maybe it shall be approved now.

Keywords:
Dark, Chaos, Phantom, Red, Purple, Bolt, Scary, Full House.
Contents

Phantom Bolt (Map)

Reviews
10:28, 30th May 2010 The_Reborn_Devil: Very well done GUI and the effects are neat. Status: Approved Rating: Recommended

Moderator

M

Moderator

10:28, 30th May 2010
The_Reborn_Devil:

Very well done GUI and the effects are neat.


Status: Approved
Rating: Recommended
 
Level 8
Joined
Jun 18, 2007
Messages
214
Uuu, I like this spell very much, good job! Effects are excellent, and as far as I can see coding is good (though I use JASS, so can't be all that sure :p).
Now only thing I have to take back from the greatness of this spell xD, is the fact that if you have a unit in front of the caster, and you cast the spell, it will not consider the unit in front of you, but instead create a dummy unit behind the front opponent :p.
I guess you increased offset somewhere a tad to much. Also try to make a better demo map and remove mask and fog of war :p.

All in all, good job, liked it: 4.5/5
 
Level 12
Joined
Jun 28, 2008
Messages
688
Thank you for pointing that out, I didn't consider that fact. I'll fix the offsets and update it when I get back to my editor computer.

And I'm not much of a terrainer/I'm too lazy to make a decent looking map, but it's functionable, and that's what really matters when testing. I'm not making a game for people to play. =P
 
Level 17
Joined
Mar 17, 2009
Messages
1,349
AMAZING AMAZING AMAZING JOB!
When you were talking about it... I didn't expect this!

Man, with GUI and you did this... what would happen when you become a vJasser!? =)

Although I'd advice you to use a wc3 icon rather than an imported one... just for rules' sake.
 
Top