[Solved] Multishot (Attack speed buff)

Level 4
Joined
Apr 8, 2021
Messages
31
Hi, i'm trying to do what seem to be not an hard ability to make but i don't have the skills to do so.
I'm trying to make an unit (archer in this case) do 3 normal autos or so than give it an item based ability that give her a lot of attack speed for the next 3 autos (so it look like the 3 auto have been shot in the same time, a multishot or something along the way) this is where i'm stuck for now :

  • Archer Multishot On
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Archer T1
    • Actions
      • Set VariableSet MultishotUnit = DamageEventSource
      • Set VariableSet MultishotCounter[0] = 0
      • Unit - Remove Attack Speed (item spell) Multishot from MultishotUnit
      • Trigger - Turn on Archer Multishot 6 <gen>
      • Trigger - Turn off (This trigger)
  • Archer Multishot 6
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • MultishotUnit Equal to DamageEventSource
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MultishotCounter[0] Equal to 0
        • Then - Actions
          • Set VariableSet MultishotCounter[0] = 6
          • Trigger - Turn on Archer Multishot 5 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Archer Multishot 5
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • MultishotUnit Equal to DamageEventSource
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MultishotCounter[0] Equal to 6
        • Then - Actions
          • Set VariableSet MultishotCounter[0] = 5
          • Trigger - Turn on Archer Multishot 4 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Archer Multishot 4
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • MultishotUnit Equal to DamageEventSource
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MultishotCounter[0] Equal to 5
        • Then - Actions
          • Set VariableSet MultishotCounter[0] = 4
          • Trigger - Turn on Archer Multishot 3 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Archer Multishot 3
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • MultishotUnit Equal to DamageEventSource
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MultishotCounter[0] Equal to 4
        • Then - Actions
          • Unit - Add Attack Speed (item spell) Multishot to MultishotUnit
          • Set VariableSet MultishotCounter[0] = 3
          • Trigger - Turn on Archer Multishot 2 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Archer Multishot 2
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • MultishotUnit Equal to DamageEventSource
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MultishotCounter[0] Equal to 3
        • Then - Actions
          • Set VariableSet MultishotCounter[0] = 2
          • Trigger - Turn on Archer Multishot 1 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Archer Multishot 1
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • MultishotUnit Equal to DamageEventSource
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MultishotCounter[0] Equal to 2
        • Then - Actions
          • Set VariableSet MultishotCounter[0] = 1
          • Trigger - Turn on Archer Multishot On <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
Thank you in advance for reading all of this ! :D
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
After copying a Unit Indexer into your map, you can try something like this.

This is an example of setting a unit up to use the Multishot ability:
  • Actions
    • Unit - Create 1 Archer T1...
    • Set VariableSet MultishotUnit = (Last created unit)
    • Trigger - Run Archer Multishot Setup (ignoring conditions)
This trigger adds the Attack Speed ability and resets the attack counter back to 3:
  • Archer Multishot Setup
    • Events
    • Conditions
    • Actions
      • Set VariableSet CV = (Custom value of MultishotUnit)
      • Set VariableSet MultishotCounter[CV] = 3
      • Unit - Remove Attack Speed (item spell) Multishot from MultishotUnit
      • Unit - Add Attack Speed (item spell) Multishot to MultishotUnit
This trigger reduces the attack counter by 1 every time the unit deals damage:
  • Archer Multishot Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (MultishotCounter[(Custom value of DamageEventSource)]) Greater than 0
    • Actions
      • Set VariableSet CV = (Custom value of DamageEventSource)
      • Set VariableSet MultishotCounter[CV] = (MultishotCounter[CV] - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MultishotCounter[CV] Equal to 0
        • Then - Actions
          • Unit - Remove Attack Speed (item spell) Multishot from DamageEventSource
        • Else - Actions
So your unit will have increased attack speed for 3 attacks. Keep in mind that missiles have a delay before they reach their target (and deal damage) so there's a good chance that the Archer can rapidly fire more than 3 attacks. Also, note that this is checking for any type of damage, so if the Archer has other ways of dealing damage then those will reduce the MultishotCounter too.

If this isn't exactly what you wanted then let me know.
 
Last edited:
Level 4
Joined
Apr 8, 2021
Messages
31
Wow thanks, that's seem to be exactly what i was trying to do, thanks Mr.Uncle, always here to find solutions for the kiddoes like me haha, thanks again !
 
Top