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

Shock Rifle - v0.1

  • Like
Reactions: FeelMyRash
See screenshot for description
...and if you didn't understand that:
-click on a unit to shoot a ball
-click on the ground to shoot a L4Z0R
-shoot a ball with a L4Z0R to make BOOOM

Credits to UT for such a funny weapon and to Champara Bros for the laser ray model
(and don't tell me about imports.....it's necessary)
it's no exact copy cause it is quite hard to shoot 2 different things with 1 button

JASS:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X                              X
X         SHOCK RIFLE          X
X                              X
X       by D4RK_G4ND4LF        X
X                              X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Credits to Champara Bros for the Laser Ray model

You will have to copy
-the shock rifle ability
-the 2 custom units
-the triggers (just copy&paste the folder)
and import the BlueLaserRay model
in order to make this spell work

Remember to enable "Automatically create unknown variables while pasting trigger data"
Check under "File - Preferences - General"

It is also recommended to create the variable "i" (Integer) manually
'cause it is known to be not created automatically

Please give credits if you intend to use this spell in your map(s)
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set zLoc = (Point(0.00, 0.00))
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Shock Rifle
  • Actions
    • -------- It is not recommended to change any values which are not marked with big letters --------
    • Set ShockRifle_Max = (ShockRifle_Max + 1)
    • Set ShockRifle_Unit[(ShockRifle_Max x 3)] = (Triggering unit)
    • Set u = (Target unit of ability being cast)
    • Custom script: call MoveLocation(udg_zLoc, GetSpellTargetX(), GetSpellTargetY())
    • Set loc = (Position of (Triggering unit))
    • Set a = (Angle from loc to zLoc)
    • -------- Decide if it was point- or unittarget --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • u Equal to No unit
      • Then - Actions
        • -------- If it was pointtarget create a laser and set all data --------
        • Unit - Create 1 ShockRifleLaser for (Owner of (Triggering unit)) at loc facing a degrees
        • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
        • -------- SET LASER RAY SPEED HERE --------
        • Set ShockRifle_Data[(ShockRifle_Max x 5)] = 50.00
        • Set ShockRifle_Data[((ShockRifle_Max x 5) + 1)] = (ShockRifle_Data[(ShockRifle_Max x 5)] x (Cos(a)))
        • Set ShockRifle_Data[((ShockRifle_Max x 5) + 2)] = (ShockRifle_Data[(ShockRifle_Max x 5)] x (Sin(a)))
        • -------- SET LASER RAY DAMAGE HERE --------
        • Set ShockRifle_Data[((ShockRifle_Max x 5) + 3)] = (Real((((Level of (Ability being cast) for (Triggering unit)) x 50) + 50)))
        • -------- SET LASER RAY AOE HERE --------
        • Set ShockRifle_Data[((ShockRifle_Max x 5) + 4)] = 150.00
        • Set ShockRifle_Unit[((ShockRifle_Max x 3) + 1)] = No unit
        • Set ShockRifle_Unit[((ShockRifle_Max x 3) + 2)] = (Last created unit)
        • Custom script: if udg_ShockRifle_Group[udg_ShockRifle_Max] == null then
        • Custom script: set udg_ShockRifle_Group[udg_ShockRifle_Max] = CreateGroup()
        • Custom script: endif
      • Else - Actions
        • -------- If it was unit target create an orb and set data --------
        • -------- SET ORB SPEED HERE --------
        • Set ShockRifle_Data[(ShockRifle_Max x 5)] = 17.00
        • -------- SET ORB DAMAGE HERE --------
        • Set ShockRifle_Data[((ShockRifle_Max x 5) + 3)] = (Real((((Level of (Ability being cast) for (Triggering unit)) x 50) + 50)))
        • -------- SET ORB AOE HERE --------
        • Set ShockRifle_Data[((ShockRifle_Max x 5) + 4)] = 300.00
        • Unit - Create 1 ShockRifleOrb for (Owner of (Triggering unit)) at loc facing a degrees
        • Unit Group - Add (Last created unit) to ShockRifle_Orbs
        • Set ShockRifle_Unit[((ShockRifle_Max x 3) + 1)] = u
        • Set ShockRifle_Unit[((ShockRifle_Max x 3) + 2)] = (Last created unit)
    • Animation - Change (Last created unit) flying height to 60.00 at 0.00
    • Custom script: call RemoveLocation(udg_loc)
    • Trigger - Turn on ShockRifleLoop <gen>
  • Events
    • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
    • For each (Integer i) from 1 to ShockRifle_Max, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ShockRifle_Unit[(i x 3)] Not equal to No unit
          • Then - Actions
            • -------- Decide if it is a laser ray or orb to be moved --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ShockRifle_Unit[((i x 3) + 1)] Equal to No unit
              • Then - Actions
                • -------- Move the laser ray forward --------
                • -------- XXXXXXXXXX --------
                • Set u = ShockRifle_Unit[((i x 3) + 2)]
                • Custom script: set udg_x = GetUnitX(udg_u)
                • Custom script: set udg_y = GetUnitY(udg_u)
                • Set x = (x + ShockRifle_Data[((i x 5) + 1)])
                • Set y = (y + ShockRifle_Data[((i x 5) + 2)])
                • -------- If the laser ray is within map bounds and alive move it forward --------
                • Custom script: if RectContainsCoords(bj_mapInitialPlayableArea, udg_x, udg_y) and GetWidgetLife(udg_u) > 0.405 then
                • Custom script: call SetUnitX(udg_u, udg_x)
                • Custom script: call SetUnitY(udg_u, udg_y)
                • -------- XXXXXXXXXX --------
                • Set r = ShockRifle_Data[((i x 5) + 4)]
                • Unit Group - Pick every unit in ShockRifle_Orbs and do (Actions)
                  • Loop - Actions
                    • Custom script: set udg_x2 = GetUnitX(GetEnumUnit())
                    • Custom script: set udg_y2 = GetUnitY(GetEnumUnit())
                    • -------- If there is an orb within laser aoe destroy it --------
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Life of (Picked unit)) Greater than 0.00
                        • (((x - x2) x (x - x2)) + ((y - y2) x (y - y2))) Less than (r x r)
                      • Then - Actions
                        • Unit - Kill (Picked unit)
                        • Custom script: set bj_wantDestroyGroup = true
                        • Custom script: call MoveLocation(udg_zLoc, udg_x2, udg_y2)
                        • -------- Damage all units hit by exploding orb --------
                        • -------- CHANGE DOUBLE DAMAGE/AOE ON ORB HIT HERE --------
                        • Unit Group - Pick every unit in (Units within (r x 2.00) of zLoc 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 u)) Equal to True) and ((Life of (Matching unit)) Grea and do (Actions)
                          • Loop - Actions
                            • -------- AND HERE --------
                            • Unit - Cause ShockRifle_Unit[(i x 3)] to damage (Picked unit), dealing (ShockRifle_Data[((i x 5) + 3)] x 2.00) damage of attack type Spells and damage type Normal
                            • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                            • Special Effect - Destroy (Last created special effect)
                      • Else - Actions
                • Custom script: set bj_wantDestroyGroup = true
                • Custom script: call MoveLocation(udg_zLoc, udg_x, udg_y)
                • -------- Damage all units hit by the laser --------
                • Unit Group - Pick every unit in (Units within r of zLoc matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is in ShockRifle_Group[i]) Equal to False)) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner and do (Actions)
                  • Loop - Actions
                    • Unit - Cause ShockRifle_Unit[(i x 3)] to damage (Picked unit), dealing ShockRifle_Data[((i x 5) + 3)] damage of attack type Spells and damage type Normal
                    • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                    • Special Effect - Destroy (Last created special effect)
                    • -------- And add them to a debug group so they wont be hit again --------
                    • Unit Group - Add (Picked unit) to ShockRifle_Group[i]
                • Custom script: else
                • -------- If the laser ray reached the map bounds it will be destroyed --------
                • Set ShockRifle_Unit[(i x 3)] = No unit
                • Unit - Kill u
                • Custom script: endif
              • Else - Actions
                • -------- Move the orb to the target --------
                • -------- XXXXXXXXXX --------
                • Set r = ShockRifle_Data[(i x 5)]
                • Set u = ShockRifle_Unit[((i x 3) + 1)]
                • Custom script: set udg_x2 = GetUnitX(udg_u)
                • Custom script: set udg_y2 = GetUnitY(udg_u)
                • Set u = ShockRifle_Unit[((i x 3) + 2)]
                • Custom script: set udg_x = GetUnitX(udg_u)
                • Custom script: set udg_y = GetUnitY(udg_u)
                • Custom script: set udg_a = Atan2(udg_y2-udg_y, udg_x2-udg_x)
                • Custom script: set udg_x = udg_x + udg_r * Cos(udg_a)
                • Custom script: set udg_y = udg_y + udg_r * Sin(udg_a)
                • Custom script: call SetUnitX(udg_u, udg_x)
                • Custom script: call SetUnitY(udg_u, udg_y)
                • -------- XXXXXXXXXX --------
                • -------- If the laser arrived its target it will explode dealing damage to all sorounding enemys --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (((x - x2) x (x - x2)) + ((y - y2) x (y - y2))) Less than (r x r)
                  • Then - Actions
                    • Custom script: call MoveLocation(udg_zLoc, udg_x, udg_y)
                    • Custom script: set bj_wantDestroyGroup = true
                    • Unit Group - Pick every unit in (Units within ShockRifle_Data[((i x 5) + 4)] of zLoc 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 u)) Equal to True) and ((Life of ( and do (Actions)
                      • Loop - Actions
                        • Unit - Cause ShockRifle_Unit[(i x 3)] to damage (Picked unit), dealing ShockRifle_Data[((i x 5) + 3)] damage of attack type Spells and damage type Normal
                        • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                        • Special Effect - Destroy (Last created special effect)
                    • -------- Remove and kill the orb --------
                    • Unit - Kill u
                    • Unit Group - Remove u from ShockRifle_Orbs
                  • Else - Actions
                • -------- If the orb is dead (either killed by a laser or just by exploding itself) this will end --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Life of u) Equal to 0.00
                  • Then - Actions
                    • Set ShockRifle_Unit[(i x 3)] = No unit
                  • Else - Actions
          • Else - Actions
            • -------- Shift data --------
            • Unit Group - Remove all units from ShockRifle_Group[i]
            • Unit Group - Add all units of ShockRifle_Group[ShockRifle_Max] to ShockRifle_Group[i]
            • Unit Group - Remove all units from ShockRifle_Group[ShockRifle_Max]
            • Set ShockRifle_Unit[(i x 3)] = ShockRifle_Unit[(ShockRifle_Max x 3)]
            • Set ShockRifle_Unit[((i x 3) + 1)] = ShockRifle_Unit[((ShockRifle_Max x 3) + 1)]
            • Set ShockRifle_Unit[((i x 3) + 2)] = ShockRifle_Unit[((ShockRifle_Max x 3) + 2)]
            • Set ShockRifle_Data[(i x 5)] = ShockRifle_Data[(ShockRifle_Max x 5)]
            • Set ShockRifle_Data[((i x 5) + 1)] = ShockRifle_Data[((ShockRifle_Max x 5) + 1)]
            • Set ShockRifle_Data[((i x 5) + 2)] = ShockRifle_Data[((ShockRifle_Max x 5) + 2)]
            • Set ShockRifle_Data[((i x 5) + 3)] = ShockRifle_Data[((ShockRifle_Max x 5) + 3)]
            • Set ShockRifle_Data[((i x 5) + 4)] = ShockRifle_Data[((ShockRifle_Max x 5) + 4)]
            • Set ShockRifle_Max = (ShockRifle_Max - 1)
            • Set i = (i - 1)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ShockRifle_Max Less than 1
              • Then - Actions
                • Trigger - Turn off (This trigger)
              • Else - Actions
Keywords:
unreal, tournament, shock, rifle, laser, weapon, star, wars
Contents

Shock Rifle (Map)

Reviews
20:20, 2nd Mar 2010 The_Reborn_Devil: The triggering looks good and the spell is unique. Status: Approved Rating: Useful

Moderator

M

Moderator

20:20, 2nd Mar 2010
The_Reborn_Devil:

The triggering looks good and the spell is unique.


Status: Approved
Rating: Useful
 
Level 2
Joined
Oct 5, 2009
Messages
30
nice spell, i definitely liked , i didnt quite get the shooting of the ball in mid air, cause it would boom anyway when it hits a unit? is there any advantage to shooting the ball in mid air?
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
I don't get what this ability does. The description's hideously bad, and the screenshot looks awful. Without testing it, i'm already rating it 1/5. I won't actually rate it, since i think i'm being a little harsh, but MAN! sucky description.

surely the page is terribly sorry for cropping my high resolution images

I said that i didn't want to give a 1/5, so i didn't. Yet, then he wrote that update, that was clearly needed, and called everyone who didn't understand it at first, an idiot, like I, and then i rated - he had it coming.

people look at the votes to see if the spell (which you did not even test) is good or bad and not to see the opinion of some dude who does not like the author
so you dont't just make me angry but mislead all those interested as well
this is the spell section - not the karma party

nice spell, i definitely liked , i didnt quite get the shooting of the ball in mid air, cause it would boom anyway when it hits a unit? is there any advantage to shooting the ball in mid air?

yes there is
it is written in the tooltip
and you can also shoot enemy's balls to prevent them from hitting you (probably not obvious if you did not play UT)

looks good and the coding is fine too
a stunn like emp would be fine :)

I had problems with stuns recently
(created a dummy, ordered it to stun, killed it per trigger and it did not die
then I removed the stun and it worked fine
I guess it is some blizzard-related bug overwriting my global variables)
I might give it another try sometime

for all the who want to add spell effects themselves:
purge will probably look cool
 
Last edited:
As i played UT 2004 veeeeery often i know what it is supposed to be and i can just say you succeded transfering this!!

Just 2 suggestions: the lightning goes to slow... in UT it is instantly at its target but lasts for a few seconds... and when you shoot an orb there should be another sfx than when hitting the enemies normal...

anyway a very good spell and i hate people who rate low without any good reason!!

5/5
 
Top