• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Battle Focus v 1.3

An aura that needs to be activated. After the activation the units within the aura's range will have 75% chance to deal 2.5x damage on an attack.
Level 1: Duration 4 seconds Area of Effect: 300.
Level 2: Duration 4.25 seconds Area of Effect: 300.
Level 3: Duration 4.5 seconds Area of Effect: 300.
Level 4: Duration 4.75 seconds Area of Effect: 300.
Level 5: Duration 5 seconds Area of Effect: 300.

v1.3- minor fixes
v1.2- mentioned things fixed
v1.1- minor fixes

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Disable Battle Focus Book for (Player((Integer A)))
          • Player - Disable Battle Focus Caster Book for (Player((Integer A)))
      • -------- First copy the dummy units then the buffs and abilities. After that copy the triggers and make sure it automatically generate new variables. --------
      • -------- After the copy the triggers may screw up sometimes. Check if the triggers you copied and the original triggers are the same. If not, fox the changes. --------
  • Battle Focus
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Battle Focus
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BFHas[BFLastRecycled] Equal to True
        • Then - Actions
          • Set BFMax = (BFMax + 1)
          • Set BFIndex = BFMax
        • Else - Actions
          • Set BFIndex = BFLastRecycled
          • Set BFLastRecycled = BFRecycledList[BFLastRecycled]
      • Set BFCaster[BFIndex] = (Triggering unit)
      • Set BFHas[BFIndex] = True
      • Set BFCount = (BFCount + 1)
      • Set BFTimer[BFIndex] = (3.75 + (0.25 x (Real((Level of Battle Focus for BFCaster[BFIndex])))))
      • Set BFAbility[BFIndex] = Battle Focus Book
      • Set BFCasterAbility[BFIndex] = Battle Focus Caster Book
      • Unit - Add BFCasterAbility[BFIndex] to BFCaster[BFIndex]
      • Set TempLoc = (Position of (Triggering unit))
      • Unit - Create 1 Battle Focus Aura for (Triggering player) at TempLoc facing Default building facing degrees
      • Set BFAura[BFIndex] = (Last created unit)
      • Animation - Change BFAura[BFIndex]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 0.00% transparency
      • Animation - Change BFAura[BFIndex]'s size to (350.00%, 350.00%, 350.00%) of its original size
      • Unit - Create 1 Battle Focus Aura for (Triggering player) at TempLoc facing Default building facing degrees
      • Set BFAura2[BFIndex] = (Last created unit)
      • Animation - Change BFAura2[BFIndex]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 0.00% transparency
      • Animation - Change BFAura[BFIndex]'s size to (250.00%, 250.00%, 250.00%) of its original size
      • Animation - Change BFAura2[BFIndex]'s animation speed to 15.00% of its original speed
      • Unit - Create 1 Battle Focus Aura for (Triggering player) at TempLoc facing Default building facing degrees
      • Set BFAura3[BFIndex] = (Last created unit)
      • Animation - Change BFAura3[BFIndex]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 0.00% transparency
      • Animation - Change BFAura3[BFIndex]'s size to (175.00%, 175.00%, 175.00%) of its original size
      • Animation - Change BFAura3[BFIndex]'s animation speed to 10.00% of its original speed
      • Set BFGroup[BFIndex] = (Units within 300.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of BFCaster[BFIndex])) Equal to True))))
      • Unit Group - Pick every unit in BFGroup[BFIndex] and do (Actions)
        • Loop - Actions
          • Unit - Add BFAbility[BFIndex] to (Picked unit)
      • Custom script: call RemoveLocation (udg_TempLoc)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Battle Focus Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Battle Focus Loop <gen>
        • Else - Actions
  • Battle Focus Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer BFInteger) from 0 to BFMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BFHas[BFInteger] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BFTimer[BFInteger] Greater than 0.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (BFCaster[BFIndex] is dead) Equal to True
                    • Then - Actions
                      • Set BFTimer[BFInteger] = 0.00
                    • Else - Actions
                      • Set BFTimer[BFInteger] = (BFTimer[BFInteger] - 0.03)
                      • Set TempLoc = (Position of BFCaster[BFInteger])
                      • Unit - Move BFAura[BFInteger] instantly to TempLoc
                      • Unit - Move BFAura2[BFInteger] instantly to TempLoc
                      • Unit - Move BFAura3[BFInteger] instantly to TempLoc
                      • Set TempGroup = (Units within 300.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of BFCaster[BFInteger])) Equal to True))))
                      • Unit Group - Pick every unit in TempGroup and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked unit) is in BFGroup[BFInteger]) Equal to False
                            • Then - Actions
                              • Unit Group - Add (Picked unit) to BFGroup[BFInteger]
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Level of Battle Focus Critical for (Picked unit)) Greater than 0
                                • Then - Actions
                                • Else - Actions
                                  • Unit - Add BFAbility[BFInteger] to (Picked unit)
                            • Else - Actions
                      • Unit Group - Pick every unit in BFGroup[BFInteger] and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked unit) is in TempGroup) Equal to False
                            • Then - Actions
                              • Unit Group - Remove (Picked unit) from BFGroup[BFInteger]
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Level of Battle Focus Critical for (Picked unit)) Greater than 0
                                • Then - Actions
                                  • Unit - Remove BFAbility[BFInteger] from (Picked unit)
                                • Else - Actions
                            • Else - Actions
                      • Custom script: call RemoveLocation (udg_TempLoc)
                      • Custom script: call DestroyGroup (udg_TempGroup)
                • Else - Actions
                  • Unit - Remove BFCasterAbility[BFInteger] from BFCaster[BFInteger]
                  • Unit Group - Pick every unit in BFGroup[BFInteger] and do (Unit - Remove BFAbility[BFInteger] from (Picked unit))
                  • Unit Group - Pick every unit in BFGroup[BFInteger] and do (Unit - Remove Battle Focus buff from (Picked unit))
                  • Unit - Remove BFAura[BFInteger] from the game
                  • Unit - Remove BFAura2[BFInteger] from the game
                  • Unit - Remove BFAura3[BFInteger] from the game
                  • Custom script: call DestroyGroup (udg_BFGroup[udg_BFInteger])
                  • Set BFCount = (BFCount - 1)
                  • Set BFHas[BFInteger] = False
                  • Set BFRecycledList[BFInteger] = BFLastRecycled
                  • Set BFLastRecycled = BFInteger
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BFCount Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                      • For each (Integer A) from 0 to BFMax, do (Set BFRecycledList[(Integer A)] = 0)
                      • Set BFLastRecycled = 0
                      • Set BFMax = 0
                    • Else - Actions
            • Else - Actions
Keywords:
battle, focus, aura, moonmage, mage, support, critical, chance, kill, desudesu, chuck norris, purple, blue, a perfect circle,
Contents

Just another Warcraft III map (Map)

Reviews
Reviewed by Maker, Battle Focus v 1.3, 27th Dec Approved. Possible improvements: Use dynamic indexing You could use a init trigger where you can set up abilities, time and AoE Improve tooltip to match standard Blizzard ability tooltips I...

Moderator

M

Moderator

Reviewed by Maker, Battle Focus v 1.3, 27th Dec

Approved.

Possible improvements:
  • Use dynamic indexing
  • You could use a init trigger where you can set up abilities, time and AoE
  • Improve tooltip to match standard Blizzard ability tooltips
  • I don't think it is necessary to do the enumerations every 0.03 seconds. 0.1 seconds could be fine.


Maker, Battle Focus v 1.1, 22nd Dec
  • Contains no importing instructions
  • Auras should place a buff on units
  • You could improve the learn tooltip. List stats for all levels
  • You don't have to remove all units from a group if you're going to destroy it right away
  • I recommend you create a setup trigger, where one can set up the unit types and abilities. Otherwise the spell is a pain to import and configure
  • Dead units bestow aura?
 
Level 7
Joined
Aug 31, 2011
Messages
125
You can put a title like this in the first tag: [hidden=Title goes here]
And for triggers:
Whenever you use a unit group that does "Unit Group - Pick every unit in "Unit Group" and do (Actions)",
you can do this custom script:
  • Custom script: set bj_wantDestroyGroup = true
right before the unit group is created instead of doing "call DestoryGroup(bla bla bla)"
And then while you're at it, you forgot to destroy this unit group:
  • Unit Group - Pick every unit in BFGroup[BFIndex] and do (Actions)
    • Loop - Actions
      • Unit - Add Battle Focus Book to (Picked unit)
 
In the cast trigger (Battle Focus), when you cache (Triggering unit) and (Last created unit) into variables, why aren't you using them? It's much more efficient to use the variables instead of repeating the functions.

Also:

  • Unit Group - Pick every unit in BFGroup[BFInteger] and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is in TempGroup) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit Group - Remove (Picked unit) from BFGroup[BFInteger]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Battle Focus Critical for (Picked unit)) Greater than 0
            • Then - Actions
              • Unit - Remove Battle Focus Book from (Picked unit)
            • Else - Actions
The group is never destroyed and why are you putting the code in the else block when you can simply change the condition to: ((Picked unit) is in TempGroup) Equal to False

The same goes for this:

  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is in BFGroup[BFInteger]) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit Group - Add (Picked unit) to BFGroup[BFInteger]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Battle Focus Critical for (Picked unit)) Greater than 0
            • Then - Actions
            • Else - Actions
              • Unit - Add Battle Focus Book to (Picked unit)
 
Level 16
Joined
Jun 24, 2009
Messages
1,409
Oh, well it's an "old" spell. I created it when I didn't have net connection. Haven't seen the code itself long time ago, just separated it from the map. I'll check the mentioned things.
Oookay, let's see.

You can put a title like this in the first tag: [hidden=Title goes here]
I know that I can add title for hidden tags but I prefer to keep it that way. It's more cleaner for me and I guess for most of the people.
Edit: Oh now I remember why didn't I use this function at there. Because of the second unit group calling. It uses the TempGroup to check the things. That function would destroy the group before it can be checked so I've just set it to a variable.

And for triggers:
Whenever you use a unit group that does "Unit Group - Pick every unit in "Unit Group" and do (Actions)",
you can do this custom script:
  • Custom script: set bj_wantDestroyGroup = true
right before the unit group is created instead of doing "call DestoryGroup(bla bla bla)"
I know ~.~ I just haven't checked the code for a while. As you can see it in my other spells I already used this function a lot.

And then while you're at it, you forgot to destroy this unit group:
  • Unit Group - Pick every unit in BFGroup[BFIndex] and do (Actions)
    • Loop - Actions
      • Unit - Add Battle Focus Book to (Picked unit)

Eeerm. Nope! Chuck Testa
At the end it gets destroyed.
  • Custom script: call DestroyGroup (udg_BFGroup[udg_BFInteger])
In the cast trigger (Battle Focus), when you cache (Triggering unit) and (Last created unit) into variables, why aren't you using them? It's much more efficient to use the variables instead of repeating the functions.
I just forgot to use it in the cast trigger itself but it the loop it will be used. I'll change this though.

Also:

  • Unit Group - Pick every unit in BFGroup[BFInteger] and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is in TempGroup) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit Group - Remove (Picked unit) from BFGroup[BFInteger]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Battle Focus Critical for (Picked unit)) Greater than 0
            • Then - Actions
              • Unit - Remove Battle Focus Book from (Picked unit)
            • Else - Actions
The group is never destroyed and why are you putting the code in the else block when you can simply change the condition to: ((Picked unit) is in TempGroup) Equal to False

The same goes for this:

  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is in BFGroup[BFInteger]) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit Group - Add (Picked unit) to BFGroup[BFInteger]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Battle Focus Critical for (Picked unit)) Greater than 0
            • Then - Actions
            • Else - Actions
              • Unit - Add Battle Focus Book to (Picked unit)
The group will be destroyed at the end.... Check the whole trigger before writing anything about it.
I'll change the else thingie.
 
Top