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

Holy Bolt 1.0

  • Like
Reactions: IRoILaurentiu
Holy Bolt
by Golden-Drake


I tried to make a simple spell with sweet eye-candy. A simple to understand and use spell.
Fires a projectile at a unit and apon impact it deals damage to units an a smalle area around the target.



  • HB Settings
    • Events
      • Time - Elapsed game time is 0.20 seconds
    • Conditions
    • Actions
      • -------- --------- --------
      • -------- Leave This (changing them might cause problems) --------
      • Hashtable - Create a hashtable
      • Set HB_Table = (Last created hashtable)
      • -------- --------- --------
      • -------- Damage (Scaling is the ammount increased per level) --------
      • Set HB_DamageBase = 25.00
      • Set HB_DamageScaling = 50.00
      • -------- --------- --------
      • -------- Speed (Pro speed is for the projectile / Eff speed is the circling bolts) --------
      • Set HB_Eff_Speed = 20.00
      • Set HB_Pro_Speed = 15.00
      • -------- --------- --------
      • -------- Area of Effect (Range of area on impact) --------
      • Set HB_AoE = 200.00
      • -------- --------- --------
      • -------- Bolt Size (Influence Lesser bolts distance to main bolt and impact radius) --------
      • Set HB_Range = 40.00


  • HB Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Bolt
    • Actions
      • -------- --------- --------
      • -------- Setting initial Variables (do not change anything in this trigger) --------
      • Set HB_Caster = (Triggering unit)
      • Set HB_Target = (Target unit of ability being cast)
      • Set HB_Point[2] = (Position of HB_Caster)
      • -------- --------- --------
      • -------- Creating Dummies (do not change anything in this trigger) --------
      • Unit - Create 1 Holy Projectile for (Owner of HB_Caster) at HB_Point[2] facing Default building facing degrees
      • Set HB_HPUnit = (Last created unit)
      • Unit Group - Add HB_HPUnit to HB_HPGroup[1]
      • Set HB_Handle = (Last created unit)
      • For each (Integer HB_Integer) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set HB_Point[(HB_Integer + 2)] = (HB_Point[2] offset by HB_Range towards ((Real(HB_Integer)) x 60.00) degrees)
          • Unit - Create 1 Lesser Projectile for (Owner of HB_Caster) at HB_Point[(HB_Integer + 2)] facing Default building facing degrees
          • Set HB_LPUnit[HB_Integer] = (Last created unit)
          • Hashtable - Save Handle OfHB_LPUnit[HB_Integer] as HB_Integer of (Key HB_Handle) in HB_Table
      • Hashtable - Save Handle OfHB_Caster as 7 of (Key HB_Handle) in HB_Table
      • Hashtable - Save Handle OfHB_Target as 8 of (Key HB_Handle) in HB_Table
      • -------- --------- --------
      • -------- Removing Leaks and starts loop (do not change anything in this trigger) --------
      • Trigger - Turn on HB Loop <gen>
      • For each (Integer HB_Integer) from 2 to 8, do (Actions)
        • Loop - Actions
          • Custom script: call RemoveLocation(udg_HB_Point[udg_HB_Integer])


  • HB Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in HB_HPGroup[1] and do (Actions)
        • Loop - Actions
          • -------- --------- --------
          • -------- Loading Units From Table (do not change anything in this trigger) --------
          • Set HB_Handle = (Picked unit)
          • Set HB_HPUnit = (Picked unit)
          • For each (Integer HB_Integer) from 1 to 6, do (Actions)
            • Loop - Actions
              • Set HB_LPUnit[HB_Integer] = (Load HB_Integer of (Key HB_Handle) in HB_Table)
          • Set HB_Caster = (Load 7 of (Key HB_Handle) in HB_Table)
          • Set HB_Target = (Load 8 of (Key HB_Handle) in HB_Table)
          • -------- --------- --------
          • -------- Creating points (do not change anything in this trigger) --------
          • Set HB_Point[2] = (Position of HB_HPUnit)
          • Set HB_Point[9] = (Position of HB_Target)
          • Set HB_Point[1] = (HB_Point[2] offset by HB_Pro_Speed towards (Angle from HB_Point[2] to HB_Point[9]) degrees)
          • For each (Integer HB_Integer) from 1 to 6, do (Actions)
            • Loop - Actions
              • Set HB_Point[(HB_Integer + 9)] = (Position of HB_LPUnit[HB_Integer])
              • Set HB_Point[(HB_Integer + 2)] = (HB_Point[1] offset by 40.00 towards ((Angle from HB_Point[2] to HB_Point[(HB_Integer + 9)]) + HB_Eff_Speed) degrees)
          • -------- --------- --------
          • -------- Moving Units (do not change anything in this trigger) --------
          • Custom script: call SetUnitX(udg_HB_HPUnit, GetLocationX(udg_HB_Point[1]))
          • Custom script: call SetUnitY(udg_HB_HPUnit, GetLocationY(udg_HB_Point[1]))
          • -------- - --------
          • Custom script: call SetUnitX(udg_HB_LPUnit[1], GetLocationX(udg_HB_Point[3]))
          • Custom script: call SetUnitY(udg_HB_LPUnit[1], GetLocationY(udg_HB_Point[3]))
          • -------- - --------
          • Custom script: call SetUnitX(udg_HB_LPUnit[2], GetLocationX(udg_HB_Point[4]))
          • Custom script: call SetUnitY(udg_HB_LPUnit[2], GetLocationY(udg_HB_Point[4]))
          • -------- - --------
          • Custom script: call SetUnitX(udg_HB_LPUnit[3], GetLocationX(udg_HB_Point[5]))
          • Custom script: call SetUnitY(udg_HB_LPUnit[3], GetLocationY(udg_HB_Point[5]))
          • -------- - --------
          • Custom script: call SetUnitX(udg_HB_LPUnit[4], GetLocationX(udg_HB_Point[6]))
          • Custom script: call SetUnitY(udg_HB_LPUnit[4], GetLocationY(udg_HB_Point[6]))
          • -------- - --------
          • Custom script: call SetUnitX(udg_HB_LPUnit[5], GetLocationX(udg_HB_Point[7]))
          • Custom script: call SetUnitY(udg_HB_LPUnit[5], GetLocationY(udg_HB_Point[7]))
          • -------- - --------
          • Custom script: call SetUnitX(udg_HB_LPUnit[6], GetLocationX(udg_HB_Point[8]))
          • Custom script: call SetUnitY(udg_HB_LPUnit[6], GetLocationY(udg_HB_Point[8]))
          • -------- --------- --------
          • -------- Checking Impact (You can change the number (2) to 1 if you want the bolt to impact at a longer distance) --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between HB_Point[1] and HB_Point[9]) Less than or equal to (HB_Range / 2.00)
            • Then - Actions
              • -------- --------- --------
              • -------- Damage and Removing units (do not change anything in this trigger) --------
              • Set HB_HPGroup[2] = (Units within HB_AoE of HB_Point[9] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of HB_Caster)) Equal to True))))
              • Unit Group - Pick every unit in HB_HPGroup[2] and do (Actions)
                • Loop - Actions
                  • Unit - Cause HB_Caster to damage (Picked unit), dealing (HB_DamageBase + (HB_DamageScaling x (Real((Level of Holy Bolt for HB_Caster))))) damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Items\StaffOfPurification\PurificationTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
              • Unit - Remove HB_HPUnit from the game
              • For each (Integer HB_Integer) from 1 to 6, do (Actions)
                • Loop - Actions
                  • Unit - Remove HB_LPUnit[HB_Integer] from the game
              • Special Effect - Create a special effect at HB_Point[9] using Abilities\Spells\Items\StaffOfPurification\PurificationCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- --------- --------
              • -------- Removing leaks and ends loop (do not change anything in this trigger) --------
              • Custom script: call DestroyGroup(udg_HB_HPGroup[2])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in HB_HPGroup[1]) Less than 1
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • -------- --------- --------
              • -------- Check if target is alive (do not change anything in this trigger) --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HB_Target is dead) Equal to True
                • Then - Actions
                  • -------- --------- --------
                  • -------- Removing units (do not change anything in this trigger) --------
                  • Unit - Remove HB_HPUnit from the game
                  • For each (Integer HB_Integer) from 1 to 6, do (Actions)
                    • Loop - Actions
                      • Unit - Remove HB_LPUnit[HB_Integer] from the game
                  • -------- --------- --------
                  • -------- Removing leaks and ends loop (do not change anything in this trigger) --------
                  • Custom script: call DestroyGroup(udg_HB_HPGroup[2])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in HB_HPGroup[1]) Less than 1
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
          • -------- --------- --------
          • -------- Removing leaks (do not change anything in this trigger) --------
          • For each (Integer HB_Integer) from 1 to 15, do (Actions)
            • Loop - Actions
              • Custom script: call RemoveLocation(udg_HB_Point[udg_HB_Integer])



Hope you like it.

Keywords:
holy, bolt, missible, projectile, disk, energy, power, sacred, god, light, flash, golden, drake
Contents

Holy Bolt (Map)

Reviews
Spell v1.0 | Reviewed by Maker | 29th Sep 2013 APPROVED The bolt looks good but the triggering could be a bit better [tr] Don't use two loops in HB Cast Put the dummy SetUnitX/Y actions into a loop Merge the two...

Moderator

M

Moderator


Spell v1.0 | Reviewed by Maker | 29th Sep 2013
APPROVED


126248-albums6177-picture66521.png


  • The bolt looks good but the triggering could be a bit better
126248-albums6177-picture66523.png


  • Don't use two loops in HB Cast
  • Put the dummy SetUnitX/Y actions into a loop
  • Merge the two first 1 to 6 loops in HB Loop
  • You don't need a unit group array. Use a non array for the casters
    and bj_wantDestroyGroup = true
[tr]
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Too many REMOVE LOCATION CALLS XD!

EDIT:

1st download.

EDIT2:

*Use
JASS:
set udg_X = GetUnitX ( udg_Unit )
JASS:
set udg_Y = GetUnitY ( udg_Unit )
coordinates when moving a units and do not use locations for moving the unit. You can use like this:
JASS:
set udg_Unit = GetTriggerUnit()
set udg_X = GetUnitX ( udg_Unit )
set udg_Y = GetUnitY ( udg_Unit )
set udg_MX = udg_X + udg_offset * Cos ( udg_Angle * 0.01747 )
set udg_MY = udg_Y + udg_offset * Sin ( udg_Angle * 0.01747 )
call SetUnitX ( udg_Unit , udg_MX )
call SetUnitY ( udg_Unit , udg_MY )
// Using coordinates will greatly reducing leaks and lags of the spell.

* Don't Use
  • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
      • Set HB_LPUnit[(Integer A)] = (Load (Integer A) of (Key HB_Handle) in HB_Table)
because it can cause some bugs. Use your own integer variable in this.

* Use this Custom script: set udg_Handle = GetHandleId ( udg_Unit )


* If you're removing location arrays then use integer loop variable for that so it is faster than writing that remove location calls
Like this:
  • For each (Integer HB_MyOwnIntegerVariable) from 1 to 15, do (Actions)
    • Loop - Actions
      • Custom script: call RemoveLocation(udg_HB_Point[udg_HB_MyOwnIntegerVariable])

It is a quick review ^^ :D.

EDIT3:

I''ll rate it 3.5/5 ( because I know that this is your first spell ^^ ) but Needs Fix
This tutorial will help you Things a GUI User Should Know
 
Last edited:

Too many REMOVE LOCATION CALLS XD!

EDIT:

1st download.

EDIT2:

*Use
JASS:
set udg_X = GetUnitX ( udg_Unit )
JASS:
set udg_Y = GetUnitY ( udg_Unit )
coordinates when moving a units and do not use locations for moving the unit. You can use like this:
JASS:
set udg_Unit = GetTriggerUnit()
set udg_X = GetUnitX ( udg_Unit )
set udg_Y = GetUnitY ( udg_Unit )
set udg_MX = udg_X + udg_offset * Cos ( udg_Angle * 0.01747 )
set udg_MY = udg_Y + udg_offset * Sin ( udg_Angle * 0.01747 )
call SetUnitX ( udg_Unit , udg_MX )
call SetUnitY ( udg_Unit , udg_MY )
// Using coordinates will greatly reducing leaks and lags of the spell.

* Don't Use
  • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
      • Set HB_LPUnit[(Integer A)] = (Load (Integer A) of (Key HB_Handle) in HB_Table)
because it can cause some bugs. Use your own integer variable in this.

* Use this Custom script: set udg_Handle = GetHandleId ( udg_Unit )


* If you're removing location arrays then use integer loop variable for that so it is faster than writing that remove location calls
Like this:
  • For each (Integer HB_MyOwnIntegerVariable) from 1 to 15, do (Actions)
    • Loop - Actions
      • Custom script: call RemoveLocation(udg_HB_Point[udg_HB_MyOwnIntegerVariable])

It is a quick review ^^ :D.

EDIT3:

I''ll rate it 3.5/5 ( because I know that this is your first spell ^^ ) but Needs Fix
This tutorial will help you Things a GUI User Should Know


i'd rather not copy something i don't understand and i do not understand any jazz-code you write (though i am working on learning it) but as 'Daffa the Mage' said i can do something about the integer
 
Level 20
Joined
Aug 13, 2013
Messages
1,696




i'd rather not copy something i don't understand and i do not understand any jazz-code you write (though i am working on learning it) but as 'Daffa the Mage' said i can do something about the integer

Ofc, It is a polar projection in GUI and this is recommended in moving units, but as you said you don't understant JASS then It's okay but this can be written in GUI custom script lines. Having a little knowledge in custom scripts must be needed not just by removing leaks.
 
Top