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

Energy Ball v1.0

The caster will conjure an orb that will move in a straight line that will strike any enemy units along the pathway. Deals explosion damage once it has travel 1200 range or hits the map boundary. All damage done is based on unit's Intelligence. 400 AOE blast area for all levels.

Level 1 - INT * 2 damage | INT * 3 explosion damage
Level 2 - INT * 4 damage | INT * 6 explosion damage
Level 3 - INT * 6 damage | INT * 8 explosion damage
Level 4 - INT * 8 damage | INT * 10 explosion damage


  • EB Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set WaveAnimationEB = 200.00
      • Set aoeEB = 200.00
      • Set DummyDistanceEB = 1200.00
      • Set DummySpeedEB = 500.00
      • Set DummyDistanceEB = 1200.00
      • Set Interval = 0.03
      • Set BlastAoeEB = 400.00
      • Set AbilityEB = Energy Ball
      • Set DummyTypeEB = Shockwave
      • Set DummyTimelifeEB = (DummyDistanceEB / DummySpeedEB)
      • Set DummySpeedIntervalEB = (DummySpeedEB x Interval)
      • Set SupportMultiLevelEB = True
      • Set MultiplierPerLevelINT = 2
      • Set MultiplierAoePerLevelINT = 3
      • Set ShowDamageEB = True
      • Set DummySFX_EB[1] = Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • Set DummySFX_EB[2] = Abilities\Weapons\Bolt\BoltImpact.mdl
      • Set DummySFX_EB[3] = Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
  • EB Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to AbilityEB
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Key2EB Equal to 0
        • Then - Actions
          • Trigger - Turn on EB Loop <gen>
        • Else - Actions
      • Set Key2EB = (Key2EB + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Key2EB Greater than KeyMaxEB
        • Then - Actions
          • Set KeyEB[Key2EB] = Key2EB
          • Set KeyMaxEB = Key2EB
        • Else - Actions
      • Set ArrayEB = KeyEB[Key2EB]
      • Set CasterEB[ArrayEB] = (Triggering unit)
      • Set CasterLocEB = (Position of CasterEB[ArrayEB])
      • Set TargetLocEB = (Target point of ability being cast)
      • Set DummyAngleEB = (Angle from CasterLocEB to TargetLocEB)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SupportMultiLevelEB Equal to True
        • Then - Actions
          • Set AbilityLevelEB = (Level of AbilityEB for CasterEB[ArrayEB])
          • Set CasterINT_EB = (Intelligence of CasterEB[ArrayEB] (Include bonuses))
          • Set DamageEB[ArrayEB] = (((Real(AbilityLevelEB)) x (Real(MultiplierPerLevelINT))) x (Real(CasterINT_EB)))
          • Set DamageAoeEB[ArrayEB] = (((Real(AbilityLevelEB)) x (Real(MultiplierAoePerLevelINT))) x (Real(CasterINT_EB)))
        • Else - Actions
          • Set DamageEB[ArrayEB] = ((Real(CasterINT_EB)) x (Real(MultiplierPerLevelINT)))
          • Set DamageAoeEB[ArrayEB] = ((Real(CasterINT_EB)) x (Real(MultiplierAoePerLevelINT)))
      • Unit - Create 1 DummyTypeEB for (Triggering player) at CasterLocEB facing DummyAngleEB degrees
      • Set DummyEB[ArrayEB] = (Last created unit)
      • Unit - Add a DummyTimelifeEB second Generic expiration timer to DummyEB[ArrayEB]
      • Animation - Change DummyEB[ArrayEB]'s animation speed to WaveAnimationEB% of its original speed
      • Custom script: set udg_UnitGroupDamagedEB[udg_ArrayEB] = CreateGroup()
      • Custom script: call RemoveLocation(udg_CasterLocEB)
      • Custom script: call RemoveLocation(udg_TargetLocEB)
  • EB Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer LoopingIntegerEB) from 1 to Key2EB, do (Actions)
        • Loop - Actions
          • Set ArrayEB = KeyEB[LoopingIntegerEB]
          • Set DummyAngleEB = (Facing of DummyEB[ArrayEB])
          • Set DummyLocEB = (Position of DummyEB[ArrayEB])
          • Set DummyMoveEB = (DummyLocEB offset by DummySpeedIntervalEB towards DummyAngleEB degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Playable map area) contains DummyMoveEB) Equal to True
            • Then - Actions
              • Custom script: call SetUnitX(udg_DummyEB[udg_ArrayEB], GetLocationX(udg_DummyMoveEB))
              • Custom script: call SetUnitY(udg_DummyEB[udg_ArrayEB], GetLocationY(udg_DummyMoveEB))
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within aoeEB of DummyLocEB) and do (Actions)
                • Loop - Actions
                  • 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 in UnitGroupDamagedEB[ArrayEB]) Equal to False
                      • ((Picked unit) belongs to an enemy of (Owner of DummyEB[ArrayEB])) Equal to True
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ShowDamageEB Equal to True
                        • Then - Actions
                          • Floating Text - Create floating text that reads (String((Integer(DamageEB[ArrayEB])))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                          • Floating Text - Set the velocity of (Last created floating text) to 150.00 towards 90.00 degrees
                          • Floating Text - Change (Last created floating text): Disable permanence
                          • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                          • Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
                        • Else - Actions
                      • Special Effect - Create a special effect attached to the origin of (Picked unit) using DummySFX_EB[2]
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Cause CasterEB[ArrayEB] to damage (Picked unit), dealing DamageEB[ArrayEB] damage of attack type Spells and damage type Normal
                      • Unit Group - Add (Picked unit) to UnitGroupDamagedEB[ArrayEB]
                    • Else - Actions
            • Else - Actions
              • Unit - Kill DummyEB[ArrayEB]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DummyEB[ArrayEB] is dead) Equal to True
            • Then - Actions
              • Special Effect - Create a special effect at DummyLocEB using DummySFX_EB[1]
              • Special Effect - Destroy (Last created special effect)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within BlastAoeEB of DummyLocEB matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of C and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ShowDamageEB Equal to True
                    • Then - Actions
                      • Floating Text - Create floating text that reads (String((Integer(DamageAoeEB[ArrayEB])))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 150.00 towards 90.00 degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
                    • Else - Actions
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using DummySFX_EB[3]
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Cause CasterEB[ArrayEB] to damage (Picked unit), dealing DamageAoeEB[ArrayEB] damage of attack type Spells and damage type Normal
              • Custom script: call DestroyGroup(udg_UnitGroupDamagedEB[udg_ArrayEB])
              • Set KeyEB[LoopingIntegerEB] = KeyEB[Key2EB]
              • Set KeyEB[Key2EB] = ArrayEB
              • Set Key2EB = (Key2EB - 1)
              • Set LoopingIntegerEB = (LoopingIntegerEB - 1)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Key2EB Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_DummyLocEB)
          • Custom script: call RemoveLocation(udg_DummyMoveEB)
v1.0
- Initial release


Credits to zarpalasjohn, because of him requesting spells in my Spell Workshop, that forced me to learn this indexing method.
All spell ideas go to him as for me, I'm just triggering it.

Keywords:
kamehameha, blue, lightning, ball, energy, defskull, move, travel, fly, INT, shock, thunder, indexing.
Contents

Just another Warcraft III map (Map)

Reviews
Moderator: Pharaoh_ Date: 02:00, 8th Jun 2012 Suggestions: You should use prefix of the spell's name in the variables, not suffix, so that they become more distinct. Instead of creating and destroy a group per cast, you could set a generic...

Moderator

M

Moderator

160036-albums4747-picture55861.png

Moderator: Pharaoh_
Date: 02:00, 8th Jun 2012

Review
Suggestions:
You should use prefix of the spell's name in the variables, not suffix, so that they become more distinct.

Instead of creating and destroy a group per cast, you could set a generic array variable with the current index being its value. Then check if the looping trigger runs the saved index, if it is, damage the unit, otherwise don't.

AoE should be configurable per cast, not a globally fixed value.

SupportMultiLevel, although nice idea, it doesn't really save performance, it actually burdens it with that check. Just directly set the values, as if it's always multilevel.

Other than that, Useful.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
I don't get why do you need to move the dummy with X/Y?

  • Unit Group - Pick every unit in (Units within aoeEB of DummyLocEB) and do (Actions)
  • Loop - Actions
  • 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 in UnitGroupDamagedEB[ArrayEB]) Equal to False
  • ((Picked unit) belongs to an enemy of (Owner of DummyEB[ArrayEB])) Equal to True
Why not simply use a group instead of these huge ITE calls?

Spell is pretty simple and it doesn't create any unique effect so I give it a 2/5.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I don't get why do you need to move the dummy with X/Y?
Because apparently, SetUnitPositionLoc (a.k.a Unit - Move Unit (Instantly)) is much slower than SetUnitX/Y, which is much slower compared to coordinates, I'll use coordinates later on.

Why not simply use a group instead of these huge ITE calls?
If I use a Unit Group, would it make a difference ?
I still have to asses those conditions ?
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
- I suggest you put the AttackType and DamageType to configurables.
- Put the 2nd condition in your loop in the first condition else part.
- Put the 3rd condition below the "Set LoopingIntegerEB = (LoopingIntegerEB - 1)"
- BUT, since you have an expiration timer for the dummy, you dont need these;
  • ((Playable map area) contains DummyMoveEB) Equal to True
  • Unit - Kill DummyEB[ArrayEB]
  • (DummyEB[ArrayEB] is dead) Equal to True
instead, in your first condition use;
  • (DummyEB[ArrayEB] is alive) Equal to True
in all the trigger and spell is good, rating it 4/5 until optimized fully...
 
Top