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

Sharp Laser v1.1 by BetaGod

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
SHARP LASER v1.1
By BetaGod

524599_10150683459634143_629724142_9493088_1732572418_n.jpg

Deploys the awesome laser feature of the goblin invention. Once the laser is launch, it will seek for enemies in a straight line, damaging every enemy target it hits. Since the ability is very hard to properly aim, the goblin engineer designed the device to deal bonus damage every 0.1 seconds, meaning that the targets that are far away from the start point will take bonus damage. Cannot affect structures.

Level 1 - Deals 95 base damage to every target it hits. Lasts 0.6 seconds and gets 5 bonus damage every 0.1 seconds.

Level 2 - Deals 170 base damage to every target it hits. Lasts 1.2 seconds and gets 7 bonus damage every 0.1 seconds.

Level 3 - Deals 245 base damage to every target it hits. Lasts 1.8 seconds and gets 9 bonus damage every 0.1 seconds.


  • Sharp Laser Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sharp Laser
    • Actions
      • -------- ---------------------------------------------------------------- --------
      • -------- Don't touch this settings --------
      • -------- ---------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SL_Skip Equal to 0
        • Then - Actions
          • Trigger - Turn on Sharp Laser Loop <gen>
        • Else - Actions
      • Set SL_Skip = (SL_Skip + 1)
      • Set SL_Times = (SL_Times + 1)
      • Set SL_Off[SL_Times] = True
      • Set SL_Timer[SL_Times] = 0.00
      • Set SL_Caster[SL_Times] = (Triggering unit)
      • Set SL_Player[SL_Times] = (Owner of SL_Caster[SL_Times])
      • Set SL_Location1[SL_Times] = (Target point of ability being cast)
      • Set SL_Location2[SL_Times] = (Position of SL_Caster[SL_Times])
      • Set SL_AbilityLevel[SL_Times] = (Level of Sharp Laser for SL_Caster[SL_Times])
      • Set SL_Offset[SL_Times] = 40.00
      • -------- ---------------------------------------------------------------- --------
      • -------- Set the base damage here --------
      • -------- ---------------------------------------------------------------- --------
      • Set SL_Damage[SL_Times] = (((Real(SL_AbilityLevel[SL_Times])) x 75.00) + 20.00)
      • -------- ---------------------------------------------------------------- --------
      • -------- For each damage interval, there is a bonus damage added to the total, configure the ammount below --------
      • -------- ---------------------------------------------------------------- --------
      • Set SL_DamageIncrease[SL_Times] = (((Real(SL_AbilityLevel[SL_Times])) x 2.00) + 3.00)
      • -------- ---------------------------------------------------------------- --------
      • -------- This is the area of effect in wich enemy units are hit by the laser --------
      • -------- ---------------------------------------------------------------- --------
      • Set SL_AoE[SL_Times] = 100.00
      • -------- ---------------------------------------------------------------- --------
      • -------- How much time (seconds) should the hero be executing the spell? --------
      • -------- ---------------------------------------------------------------- --------
      • Set SL_Duration[SL_Times] = ((Real(SL_AbilityLevel[SL_Times])) x 0.60)
      • -------- ---------------------------------------------------------------- --------
      • -------- Every X interval of spell time, the target units gets damaged. Configure X below --------
      • -------- ---------------------------------------------------------------- --------
      • Set SL_DamageInterval[SL_Times] = 0.10
      • -------- ---------------------------------------------------------------- --------
      • -------- Special effect shown when laser hits --------
      • -------- ---------------------------------------------------------------- --------
      • Set SL_SFX = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • -------- ---------------------------------------------------------------- --------
      • -------- Below this line are the Min and Max lifetime of each lightning effect (A lightning gets created at every damage interval). I heavily recommend leaving this at it is --------
      • -------- ---------------------------------------------------------------- --------
      • Set DurMin = 0.30
      • Set DurMax = 0.50
      • -------- ---------------------------------------------------------------- --------
      • -------- Don't touch this settings --------
      • -------- ---------------------------------------------------------------- --------
      • Set SL_3[SL_Times] = (Random real number between 0.00 and 100.00)
      • Set SL_4[SL_Times] = (Random real number between 0.00 and 100.00)
      • Set SL_Angle[SL_Times] = ((Angle from SL_Location1[SL_Times] to SL_Location2[SL_Times]) + 300.00)
      • Unit - Pause SL_Caster[SL_Times]
      • Unit - Create 1 Dummy for SL_Player[SL_Times] at SL_Location1[SL_Times] facing Default building facing degrees
      • Set SL_Dummy[SL_Times] = (Last created unit)
      • Unit - Add a SL_Duration[SL_Times] second Generic expiration timer to SL_Dummy[SL_Times]
      • Custom script: call RemoveLocation(udg_SL_Location1[udg_SL_Times])
      • Custom script: call RemoveLocation(udg_SL_Location2[udg_SL_Times])

  • Sharp Laser Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • -------- ---------------------------------------------------------------- --------
      • -------- Don't touch this settings --------
      • -------- ---------------------------------------------------------------- --------
      • For each (Integer SL) from 1 to SL_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SL_Off[SL] Equal to True
            • Then - Actions
              • Set SL_Timer[SL] = (SL_Timer[SL] + 0.02)
              • Set SL_Duration[SL] = (SL_Duration[SL] - 0.02)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SL_Duration[SL] Less than or equal to 0.00
                • Then - Actions
                  • Unit - Unpause SL_Caster[SL]
                  • Set SL_Skip = (SL_Skip - 1)
                  • Set SL_Off[SL] = False
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SL_Skip Equal to 0
                    • Then - Actions
                      • Set SL_Times = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SL_Timer[SL] Greater than or equal to SL_DamageInterval[SL]
                    • Then - Actions
                      • Set SL_Timer[SL] = 0.00
                      • Set SL_DamageIncrease[SL] = (SL_DamageIncrease[SL] x 2.00)
                      • Set SL_Location1[SL] = (Position of SL_Dummy[SL])
                      • Set SL_Location2[SL] = (SL_Location1[SL] offset by SL_Offset[SL] towards SL_Angle[SL] degrees)
                      • Set SL_1[SL] = (X of SL_Location1[SL])
                      • Set SL_2[SL] = (Y of SL_Location1[SL])
                      • Unit - Move SL_Dummy[SL] instantly to SL_Location2[SL]
                      • Animation - Play SL_Caster[SL]'s spell animation
                      • Unit - Make SL_Caster[SL] face SL_Location1[SL] over 0.00 seconds
                      • Custom script: set bj_lastCreatedLightning = AddLightningEx("AFOD", true, GetUnitX(udg_SL_Caster[udg_SL]), GetUnitY(udg_SL_Caster[udg_SL]), udg_SL_3[udg_SL], udg_SL_1[udg_SL], udg_SL_2[udg_SL], udg_SL_4[udg_SL])
                      • Custom script: call TimedL.U2P(bj_lastCreatedLightning, udg_SL_Caster[udg_SL], GetRandomReal(udg_DurMin,udg_DurMax), GetUnitX(udg_SL_Caster[udg_SL]), GetUnitY(udg_SL_Caster[udg_SL]), udg_SL_1[udg_SL], udg_SL_2[udg_SL], udg_SL_3[udg_SL], udg_SL_4[udg_SL], 1, 0)
                      • Special Effect - Create a special effect at SL_Location2[SL] using SL_SFX
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: set bj_wantDestroyGroup = true
                      • Unit Group - Pick every unit in (Units within SL_AoE[SL] of SL_Location2[SL] matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) belongs to an enemy of SL_Player[SL]) Equal to True))) and do (Actions)
                        • Loop - Actions
                          • Unit - Cause SL_Caster[SL] to damage (Picked unit), dealing (SL_Damage[SL] + SL_DamageIncrease[SL]) damage of attack type Spells and damage type Normal
                      • Custom script: call RemoveLocation(udg_SL_Location1[udg_SL])
                      • Custom script: call RemoveLocation(udg_SL_Location2[udg_SL])
                    • Else - Actions
            • Else - Actions


REQUIRED LIBRARY: Timed Lightnings by Maker


v1.1 changelog:
-Increase missile speed on base ability to 999 in order to avoid fps drop when spell gets casted multiple times

v1.0 changelog:
-Public Release

Keywords:
lightning, tinker, invention, aim, laser, gun, explosive
Contents

Sharp Laser v1.1 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 16 July 2012 Bribe: I will approve this as soon as you improve the importing instructions (for example notify the user they will need the latest JNGP/JassHelper to power this). This...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

16 July 2012
Bribe: I will approve this as soon as you improve the importing instructions (for example notify the user they will need the latest JNGP/JassHelper to power this).

Reviewed by Maker, Sharp Laser v1.0, 24th Apr 2012

This looks like a cool spell but it causes heavy fps frop after casting it a few times.
 
Level 4
Joined
Apr 11, 2012
Messages
67
Why I got Sharp Laser Loop Error Ive already copy all of the requirements what is the possible way to fix it ?
 
Level 11
Joined
May 13, 2010
Messages
167
Seems to be a nice spell :)

But after about 10 casts (set cooldown to 0), FPS starts to drop. It is not the lightnings that cause it, I deleted even the library and tested. Dummies seem to be cleared properly. Try to find the cause.

mmmmmm.. that's weird.. I will check the code out!

Why I got Sharp Laser Loop Error Ive already copy all of the requirements what is the possible way to fix it ?

Check the variable names in the call function of Maker's Timed Lightning library. The must ALL begin with the "udg_" prefix!
 
Last edited:
Top