Spell Battle Rage

Flare

Stops copies me!
Reaction score
662
Battle Rage

The hero enters an absolute rage, and begins leaping around the battlefield slashing enemies for (100-150 + 25 per additional unit hit) damage to each target. Jumps 4/8/12 times. If there are no nearby units, the spell will end.

Details:
GUI/JASS? GUI
MUI? Yes, up to 100 instances
Leakless? As far as I know, yes
Laggy? With 2+ casts on a big cluster of creeps, yes. Single cast doesn't show only lag (for me at least)

Importing this spell:
In File -> Preferences, enable 'Automatically create unknown variables when pasting triggers'
Copy the base spell Battle Rage
Copy the triggers Cast and Slash located within the Omnislash category
Add the ability to a hero (preferably Blademaster model)
Enjoy ^^


Code:
Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Battle Rage 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                CustomVal Less than or equal to 99
            Then - Actions
                Set CustomVal = (CustomVal + 1)
            Else - Actions
                Set CustomVal = CustomVal
        Set Caster[CustomVal] = (Triggering unit)
        Set Time[CustomVal] = 1.00
        Unit Group - Add Caster[CustomVal] to OmniGroup
        Set MaxHits[CustomVal] = (4 x (Level of Battle Rage  for Caster[CustomVal]))
        Animation - Change Caster[CustomVal]'s animation speed to 80.00% of its original speed
        Unit - Pause Caster[CustomVal]
        Special Effect - Create a special effect attached to the weapon of Caster[CustomVal] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
        Unit - Turn collision for Caster[CustomVal] Off
        Set SpecialFX[CustomVal] = (Last created special effect)
        Set RandomPt = (Random point in (Playable map area))
        Unit - Create 1 Hidden Dummy for (Owner of Caster[CustomVal]) at RandomPt facing Default building facing degrees
        Unit - Set the custom value of (Last created unit) to CustomVal
        Unit Group - Add (Last created unit) to DummyGroup
        Set UnusedDummy[CustomVal] = (Last created unit)
        Custom script:   call RemoveLocation (udg_RandomPt)

Code:
Slash
    Events
        Time - Every 0.01 seconds of game time
    Conditions
        (Number of units in OmniGroup) Greater than 0
    Actions
        Unit Group - Pick every unit in DummyGroup and do (Actions)
            Loop - Actions
                Set RandomPt = (Random point in (Playable map area))
                Unit - Create 1 Hidden Dummy for (Owner of (Picked unit)) at RandomPt facing Default building facing degrees
                Unit - Set the custom value of (Last created unit) to (Custom value of (Picked unit))
                Unit - Add a 0.02 second Generic expiration timer to (Last created unit)
                Set Time[(Custom value of (Last created unit))] = (Time[(Custom value of (Last created unit))] - 0.01)
                Unit Group - Pick every unit in OmniGroup and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                CurrentHits[(Custom value of (Last created unit))] Equal to MaxHits[(Custom value of (Last created unit))]
                            Then - Actions
                                Unit - Unpause Caster[(Custom value of (Last created unit))]
                                Animation - Reset Caster[(Custom value of (Last created unit))]'s animation
                                Animation - Change Caster[(Custom value of (Last created unit))]'s animation speed to 100.00% of its original speed
                                Unit Group - Remove Caster[(Custom value of (Last created unit))] from OmniGroup
                                Set CurrentHits[(Custom value of (Last created unit))] = 0
                                Special Effect - Destroy SpecialFX[(Custom value of (Last created unit))]
                                Unit - Kill UnusedDummy[(Custom value of (Last created unit))]
                                Unit Group - Remove UnusedDummy[(Custom value of (Last created unit))] from DummyGroup
                            Else - Actions
                                Set CasterLoc[(Custom value of (Last created unit))] = (Position of Caster[(Custom value of (Last created unit))])
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                    Then - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                TargPicked[(Custom value of (Last created unit))] Equal to False
                                            Then - Actions
                                                Set TargetGroup[(Custom value of (Last created unit))] = (Units within 500.00 of CasterLoc[(Custom value of (Last created unit))] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Ethereal) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belo
                                            Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Number of units in TargetGroup[(Custom value of (Last created unit))]) Greater than 0
                                            Then - Actions
                                                Set RandomUnit[(Custom value of (Last created unit))] = (Random 1 units from TargetGroup[(Custom value of (Last created unit))])
                                                Unit Group - Pick every unit in RandomUnit[(Custom value of (Last created unit))] and do (Actions)
                                                    Loop - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                TargPicked[(Custom value of (Last created unit))] Equal to False
                                                            Then - Actions
                                                                Animation - Play Caster[(Custom value of (Last created unit))]'s attack slam animation
                                                                Set Target[(Custom value of (Last created unit))] = (Picked unit)
                                                                Set TargetLoc[(Custom value of (Last created unit))] = (Position of Target[(Custom value of (Last created unit))])
                                                                Set TargInRange[(Custom value of (Last created unit))] = True
                                                                Set TargPicked[(Custom value of (Last created unit))] = True
                                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        Flying[(Custom value of (Last created unit))] Equal to False
                                                    Then - Actions
                                                        Unit - Add Storm Crow Form to Caster[(Custom value of (Last created unit))]
                                                        Animation - Change Caster[(Custom value of (Last created unit))] flying height to 300.00 at 600.00
                                                        Unit - Remove Storm Crow Form from Caster[(Custom value of (Last created unit))]
                                                        Set Flying[(Custom value of (Last created unit))] = True
                                                    Else - Actions
                                                Set Distance[(Custom value of (Last created unit))] = ((Distance between CasterLoc[(Custom value of (Last created unit))] and TargetLoc[(Custom value of (Last created unit))]) - 100.00)
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        Time[(Custom value of (Last created unit))] Equal to 0.50
                                                    Then - Actions
                                                        Unit - Add Storm Crow Form to Caster[(Custom value of (Last created unit))]
                                                        Animation - Change Caster[(Custom value of (Last created unit))] flying height to 0.00 at 600.00
                                                        Unit - Remove Storm Crow Form from Caster[(Custom value of (Last created unit))]
                                                    Else - Actions
                                                Set Angle[(Custom value of (Last created unit))] = (Angle from CasterLoc[(Custom value of (Last created unit))] to TargetLoc[(Custom value of (Last created unit))])
                                                Set CasterMoveLoc[(Custom value of (Last created unit))] = (CasterLoc[(Custom value of (Last created unit))] offset by ((Distance[(Custom value of (Last created unit))] / 100.00) / Time[(Custom value of (Last created unit))]) towards Angle[(Custom value of (Last created unit))] degrees)
                                                Unit - Move Caster[(Custom value of (Last created unit))] instantly to CasterMoveLoc[(Custom value of (Last created unit))]
                                                Unit - Make Caster[(Custom value of (Last created unit))] face Angle[(Custom value of (Last created unit))] over 0.00 seconds
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        Time[(Custom value of (Last created unit))] Equal to 0.01
                                                    Then - Actions
                                                        Set Time[(Custom value of (Last created unit))] = 1.00
                                                        Set Damage[(Custom value of (Last created unit))] = ((Random real number between 100.00 and 150.00) + (25.00 x (Real(CurrentHits[(Custom value of (Last created unit))]))))
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                (Distance between CasterLoc[(Custom value of (Last created unit))] and TargetLoc[(Custom value of (Last created unit))]) Less than or equal to 120.00
                                                            Then - Actions
                                                                Set TargPicked[(Custom value of (Last created unit))] = False
                                                                Unit - Cause Caster[(Custom value of (Last created unit))] to damage Target[(Custom value of (Last created unit))], dealing Damage[(Custom value of (Last created unit))] damage of attack type Hero and damage type Normal
                                                                Special Effect - Create a special effect attached to the head of Target[(Custom value of (Last created unit))] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                                                                Special Effect - Destroy (Last created special effect)
                                                                Floating Text - Create floating text that reads ((String((Integer(Damage[(Custom value of (Last created unit))])))) + !) at TargetLoc[(Custom value of (Last created 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 64.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 2.50 seconds
                                                                Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
                                                                Set CurrentHits[(Custom value of (Last created unit))] = (CurrentHits[(Custom value of (Last created unit))] + 1)
                                                            Else - Actions
                                                        Set Flying[(Custom value of (Last created unit))] = False
                                                        Custom script:   call RemoveLocation (udg_CasterLoc[GetUnitUserData(GetLastCreatedUnit())])
                                                        Custom script:   call DestroyGroup (udg_RandomUnit[GetUnitUserData(GetLastCreatedUnit())])
                                                        Custom script:   call RemoveLocation (udg_TargetLoc[GetUnitUserData(GetLastCreatedUnit())])
                                                        Custom script:   call DestroyGroup (udg_TargetGroup[GetUnitUserData(GetLastCreatedUnit())])
                                                    Else - Actions
                                            Else - Actions
                                                Unit - Unpause Caster[(Custom value of (Last created unit))]
                                                Animation - Reset Caster[(Custom value of (Last created unit))]'s animation
                                                Animation - Change Caster[(Custom value of (Last created unit))]'s animation speed to 100.00% of its original speed
                                                Unit - Turn collision for Caster[(Custom value of (Last created unit))] On
                                                Unit Group - Remove Caster[(Custom value of (Last created unit))] from OmniGroup
                                                Set CurrentHits[(Custom value of (Last created unit))] = 0
                                                Special Effect - Destroy SpecialFX[(Custom value of (Last created unit))]
                                                Unit - Kill UnusedDummy[(Custom value of (Last created unit))]
                                                Unit Group - Remove UnusedDummy[(Custom value of (Last created unit))] from DummyGroup
                                    Else - Actions



If you find any bugs, have any suggestions or simply have an opinion on the spell, please post

The hero 'floating' through the air for the first jump is something I can't seem to fix. Reducing animation speed only takes effect after the first attack slam animation is played.
 

Attachments

  • Battle Rage (TH.net submission).w3x
    23.4 KB · Views: 211

Daskunk

SC2 Forum MVP - TheSkunk #386
Reaction score
186
When I made them all cast at once, at lagged alot and one of them got stuck in the sky (I could still make him walk around, but he was flying), and when you do it next to only ONE unit he hop's up and down in the same place sliceing them, wich might not be a bug..

I'm no good at triggers though, so I cant help...
 

Flare

Stops copies me!
Reaction score
662
hmmm, i kno that multiple casts lag, i said it in the spells description.

the flying bug, that shouldnt occur... units flying height is set to 0 before the caster damages. the unit should be removed from the unit group before his height can be changed... ill look into it.

and yes, the ability is intended to hit 1 unit over and over until it dies/your hero runs out of strikes ^^ (since the distance between caster and target is never changing, the hero cant exactly chase down a non-moving target ^^).
thats why i placed a single unit on his own, so u cud see the full effect of the ability vs a single unit
 

Trollvottel

never aging title
Reaction score
262
nono the problem is CustomVal is global too and so you wont be able to use this ability many times without this bugs...
 

Frozenwind

System maker
Reaction score
99
Then I'd start learning what "locals" are.
Local's are declared at the start of a function (either as first action in a unitgroup loop or in the beginning of the whole trigger).
Local's are variables that only work in 1 function which can be passed over to other functions by using globals.

Example:
Code:
local unit a = GetLastCreatedUnit() [I]--> you can also store a unit by using a global as in: "set a = udg_your_unit_variable"[/I]
local location b
[del]local location a[/del][I] --> can't have 2x the same name within 1 function[/I]
You can transfer the local into a global variable to be able to use it in a GUI function:
JASS:
set udg_your_unit_variable = a


frozenwind.
 

Frozenwind

System maker
Reaction score
99
In your case:
I personnaly don't know a way to pass locals over to periodic events, but I'm sure its possible though.
Anyway, you could use unitgroups with arrays, the array is the custom value:
Code:
Integer A from 0 to --max array--
    if unitgroup[A] contains unit...
        then use integer A as its custom value:)

frozenwind.

EDIT PS:
Don't forget removing the unit if u increase the custom value!
EDIT2 PS2:
JASS:
set bj_ForLoopIndexA = --max array--

if you do that it won't continue with the remaining Integer A's (example: you're at 8/999, useless to check the other 991, right? So you just set the bj of integer A called "bj_ForLoopIndexA" to 999), great lag prevention.
 

Flare

Stops copies me!
Reaction score
662
removing what unit...?

oh ye, it shouldnt matter if i make CustomVal a local since the periodic event uses Unit - Custom Value of Unit for arrays

f you do that it won't continue with the remaining Integer A's (example: you're at 8/999, useless to check the other 991, right? So you just set the bj of integer A called "bj_ForLoopIndexA" to 999), great lag prevention.

i honestly dont know what you are talking about... no offense but telling me stuff i dont understand isnt gonna help me fix that bug...
 

Frozenwind

System maker
Reaction score
99
Flare said:
removing what unit...?
I meant remove unit from group[customval] when you increase its customvalue.
Only if you use the unitgroup's as customvalue replacer.

frozenwind.

EDIT:
Lemme explain better then:
You got some unitgroup variable with array (you know what array is, right?), those array values are the "custom value's".
So if unitgroup[5] contains your_unit, then his customvalue = 5.

And for this:
frozenwind said:
JASS:
set bj_ForLoopIndexA = --max array--
This just decrease the lag by ending the (GUI-)loop right away.
 

Flare

Stops copies me!
Reaction score
662
still not really getting you...
1) all the units i use are removed or killed (either exp timer or Remove Unit)

2) uhm... again, i dont know diddly-squat about JASS so you may as well be speaking japanese to me (i dont know japanese, just so you know)

EDIT: the flying hero bug only occurs when 3 heroes are doing the actions at the same time.... and its the hero who casts first that gets caught in midair... very strange xD

EDIT: even stranger... the bug DOESNT occur if the second or third blademaster casts the spell first :O
 

Frozenwind

System maker
Reaction score
99
Flare said:
2) uhm... again, i dont know diddly-squat about JASS so you may as well be speaking japanese to me (i dont know japanese, just so you know)
Good, cos me neither :).
Let's see...
bj_forLoopAIndex would be called "Integer A" in GUI.
If you convert your GUI function to JASS you'll see this:


So if you write set bj_forLoopAIndex = bj_forLoopAIndexEnd in a customscript in your loop, you'll instantly quit the loop.

Flare said:
1) all the units i use are removed or killed (either exp timer or Remove Unit)
I meant removing units from unitgroup[array], not from the game.

Forget EVERYTHING I said:
Code:
Integer A from 0 to --max array--
    if unitgroup[A] contains unit...
        then use integer A as its custom value:)
        Custom Script: (set bj_forLoopAIndex = bj_forLoopAIndexEnd)
If you do it like that, you got 1 unitgrouparray variable, the array is equal to the custom value of the unit. With the trigger above you can check it's custom value, storing it into "Integer A" a sort of..

frozenwind.
 
S

steveROGERS

Guest
Icon Ideas

Hope I'm not overstepping my boundaries here.

Here's an icon suggestion for Battle Rage. It's primarily based off critical strike seeming as the casting unit is a Blademaster:

BTNBattleRage.jpg
DISBTNBattleRage.jpg


Just a suggestion.
 

Attachments

  • DISBTNBattleRage.TGA
    14.9 KB · Views: 183
  • BTNBattleRage.TGA
    15.1 KB · Views: 166

Flare

Stops copies me!
Reaction score
662
@ steveROGERS: wow, nice icon, mite add it if i get around to working on the spell again

@ hellknight: if you read the 1st post, i said that it was laggy if you cast 2+ times on a cluster of units. thanks for pointing out the pathing bit, and the green square isnt THAT big a deal tbh, but ill change it if i get back to working on the spell, but i need a solution to the triple-cast bug (if all 3 heroes cast at same time, one remains in midair)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top